nCine::AudioReaderWav class

Audio reader for the WAVE (.wav) format.

Base classes

class IAudioReader
Interface for an audio reader.

Constructors, destructors, conversion operators

AudioReaderWav(std::unique_ptr<Death::IO::Stream> fileHandle, std::int32_t bytesPerSample, std::int64_t dataOffset, std::int64_t dataSize)
AudioReaderWav(const AudioReaderWav&) deleted

Public functions

auto operator=(const AudioReaderWav&) -> AudioReaderWav& deleted
auto Read(void* buffer, std::int32_t bufferSize) const -> std::int32_t override
Decodes audio data into the specified buffer.
void Rewind() const override
Rewinds the reader back to the beginning.

Function documentation

nCine::AudioReaderWav::AudioReaderWav(std::unique_ptr<Death::IO::Stream> fileHandle, std::int32_t bytesPerSample, std::int64_t dataOffset, std::int64_t dataSize)

Parameters
fileHandle
bytesPerSample Needed to byte-swap the samples on big-endian targets
dataOffset Where the samples begin in the file, the stream has to be there already
dataSize Size of the samples in bytes, the file can have other chunks after them

std::int32_t nCine::AudioReaderWav::Read(void* buffer, std::int32_t bufferSize) const override

Decodes audio data into the specified buffer.

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