O'Reilly logo

Android NDK Game Development Cookbook by Viktor Latypov, Sergey Kosarevsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Decoding Ogg Vorbis files

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.

Getting ready

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.

How to do it...

  1. We add the IsEOF() method to the iWaveDataProvider interface. This is used to inform AudioSource when the sound is finished:
      virtual bool    IsEOF() const { return true; }
  2. Another method we add is Seek(), which rewinds the audio stream:
      virtual void    Seek( float Time ) {}
  3. In the DecodingProvider class, we implement ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required