Defined in:Called when audio data is needed.
virtual bool FillBuffer(uint32 bufferSize, Sample *buffer, int32 *count) = 0;
||The number of bytes of audio data that is needed.|
||A pointer to the buffer that is to receive the audio data.|
||A pointer to an integer that receives the total number of frames written to the buffer.|
DescriptionThe Sound Manager calls the
FillBufferfunction when audio data is needed from a stream. The streamer should fill the buffer specified by the
bufferparameter with as many audio samples as possible without exceeding the byte count specified by the
bufferSizeparameter. Each audio sample is 16 bits in size, and the data should be stored in little endian byte order.
The value of
bufferSizewill never be larger than the value of the
streamSizeparameter passed to the
SoundStreamer::AllocateStreamMemoryfunction. The actual number of audio frames written to the buffer should be written to the integer pointed to by the
The return value should be
trueif there is more audio data available in the stream after filling the buffer, and it should be
falseif the end of the stream has been reached.
FillBufferfunction can be called in the main thread or in a special streaming thread maintained by the Sound Manager. The implementation of this function should not make any assumptions about which thread it's running in, and it should take care to use proper multithreaded synchronization where necessary.