nCine::IAudioReader class

Interface for an audio reader.

Decodes audio samples on demand from a file opened by an IAudioLoader. Stream players call read() repeatedly to refill their buffer queue.

Derived classes

class AudioReaderMpt
Audio reader for tracker module formats, backed by libopenmpt.
class AudioReaderOgg
Audio reader for the Ogg Vorbis format, backed by libvorbis.
class AudioReaderWav
Audio reader for the WAVE (.wav) format.

Constructors, destructors, conversion operators

~IAudioReader() virtual

Public functions

auto read(void* buffer, std::int32_t bufferSize) const -> std::int32_t pure virtual
Decodes audio data into the specified buffer.
void rewind() const pure virtual
Rewinds the reader back to the beginning.
void setLooping(bool value) virtual
Enables native stream looping if the format supports it.

Function documentation

std::int32_t nCine::IAudioReader::read(void* buffer, std::int32_t bufferSize) const pure virtual

Decodes audio data into the specified buffer.

Parameters
buffer Destination buffer
bufferSize Buffer size in bytes
Returns Number of bytes actually written