Ogg Vorbis is a widely used, free, open, and patent-free audio compression format. It is comparable to other formats used to store and play digital music, such as MP3, VQF, and AAC.
The reader should be familiar with the sound streaming technique from the previous recipe. The details on the .ogg
container file format and the Vorbis audio compression algorithm can be found at http://xiph.org.
We add the
IsEOF()
method to theiWaveDataProvider
interface. This is used to informAudioSource
when the sound is finished:virtual bool IsEOF() const { return true; }
Another method we add is
Seek()
, which rewinds the audio stream:virtual void Seek( float Time ) {}
In the
DecodingProvider
class, we implement theStreamWaveData()
member function, which reads the decoded sound data from a source memory block using theReadFromFile()
method:class DecodingProvider: public StreamingWaveDataProvider { clPtr<Blob> FRawData; public: bool...