struct audio_encoder audio¶
struct audio_encoder { … } Abstract base class for audio encoders, providing methods for opening, writing, and closing audio files.
destructor ~audio_encoder() ¶
virtual ~audio_encoder() Destructor to close and finalize file encoding.
Defined at audio/encoder.hpp:52
function open(std::shared_ptr<binary_writer>, const audiofile_format &, audio_decoder *) ¶
[[nodiscard]] virtual expected<void, audiofile_error> open(std::shared_ptr<binary_writer> writer,
const audiofile_format& format,
audio_decoder* copyMetadataFrom = nullptr) = 0 Opens the encoder with a binary writer and format.
| writer | Shared pointer to the binary writer. |
| format | Audio file format to use. |
| copyMetadataFrom | Optional decoder to copy metadata from. |
| Expected result indicating success or an audiofile error. |
Defined at audio/encoder.hpp:59
function open(const file_path &, const audiofile_format &, audio_decoder *) ¶
[[nodiscard]] expected<void, audiofile_error> open(const file_path& path, const audiofile_format& format,
audio_decoder* copyMetadataFrom = nullptr) Opens the encoder with a file path and format.
| path | Path to the file to open. |
| format | Audio file format to use. |
| copyMetadataFrom | Optional decoder to copy metadata from. |
| Expected result indicating success or an audiofile error. |
Defined at audio/encoder.hpp:68
function open(const std::string &, const audiofile_format &, audio_decoder *) ¶
[[nodiscard]] expected<void, audiofile_error> open(const std::string& path,
const audiofile_format& format,
audio_decoder* copyMetadataFrom = nullptr) Opens the encoder with a string path and format (Windows-specific).
| path | String path to the file to open. |
| format | Audio file format to use. |
| copyMetadataFrom | Optional decoder to copy metadata from. |
| Expected result indicating success or an audiofile error. |
Defined at audio/encoder.hpp:78
function write(const audio_data_interleaved &) ¶
[[nodiscard]] virtual expected<void, audiofile_error> write(const audio_data_interleaved& data) = 0 Writes a chunk of interleaved audio data to the encoder.
| data | Interleaved audio data to write. |
| Expected result indicating success or an audiofile error. |
Defined at audio/encoder.hpp:86
function close() ¶
[[nodiscard]] virtual expected<uint64_t, audiofile_error> close() = 0 Closes the encoder and finalizes the file.
| Expected result with the total number of frames written or an audiofile error. |
Defined at audio/encoder.hpp:90
function format() ¶
[[nodiscard]] const std::optional<audiofile_format>& format() const noexcept Retrieves the current audio file format.
| Optional containing the audio file format if set. |
Defined at audio/encoder.hpp:94
function writer() ¶
std::shared_ptr<binary_writer> writer() const noexcept Retrieves the binary writer associated with the encoder.
| Shared pointer to the binary writer. |
Defined at audio/encoder.hpp:98
variable m_format ¶
std::optional<audiofile_format> m_format Defined at audio/encoder.hpp:101
variable m_writer ¶
std::shared_ptr<binary_writer> m_writer Defined at audio/encoder.hpp:102
Defined at audio/encoder.hpp:48