KFR

Audio IO functions

audio_writer_wav

template<typename T>
class audio_writer_wav

WAV format writer

audio_writer_wav(std::shared_ptr<abstract_writer<>> &&writer, const audio_format &fmt)

Constructs WAV writer using target writer and format

Source:

audio_writer_wav(std::shared_ptr<abstract_writer<>>&& writer, const audio_format& fmt)
size_t write(const T *data, size_t size)

Write data to underlying binary writer

Source:

size_t write(const T* data, size_t size)
void close()

Finishes writing and closes underlying writer

Source:

void close()
const audio_format_and_length &format() const

Returns format description

Source:

const audio_format_and_length& format() const
imax tell() const

Returns current position

Source:

imax tell() const

audio_reader_wav

template<typename T>
class audio_reader_wav

WAV format reader

audio_reader_wav(std::shared_ptr<abstract_reader<>> &&reader)

Constructs WAV reader

Source:

audio_reader_wav(std::shared_ptr<abstract_reader<>>&& reader)
const audio_format_and_length &format() const

Returns audio format description

Source:

const audio_format_and_length& format() const
size_t read(T *data, size_t size)

Reads and decodes audio data

Source:

size_t read(T* data, size_t size)
imax tell() const

Returns current position

Source:

imax tell() const
bool seek(imax offset, seek_origin origin)

Seeks to specific sample

Source:

bool seek(imax offset, seek_origin origin)

audio_reader_flac

template<typename T>
class audio_reader_flac

FLAC format reader

audio_reader_flac(std::shared_ptr<abstract_reader<>> &&reader)

Constructs FLAC reader

Source:

audio_reader_flac(std::shared_ptr<abstract_reader<>>&& reader)
const audio_format_and_length &format() const

Returns audio format description

Source:

const audio_format_and_length& format() const
size_t read(T *data, size_t size)

Reads and decodes audio data

Source:

size_t read(T* data, size_t size)
imax tell() const

Returns current position

Source:

imax tell() const
bool seek(imax offset, seek_origin origin)

Seeks to specific sample

Source:

bool seek(imax offset, seek_origin origin)