Thursday, September 13, 2007

OpenAl & ogg/ vorbis libraries

In our engine we were using Alut to be able to load and play .wav audio files.
However there was two points we didn't like:
- Alut is a messy C code without namespace and lots of defines that have very generic names. Hence we tread interactions between the alut code and ours (or the programmer using oge).
- We use alut only for Wav files which is a proprietary codec. And as we want to use open license audio codec (such as ogg) we need to recreate some parts of alut anyway.

Hence I decided to rewrite the oge::AudioManager to remove any alut dependencies and add libogg and libvorbis support. And after some hours of work here it is ogg support (streamed or in-memory). As wav files are very common I must also rewrite the alutLoadWAV method.

It is a preliminary version and will need some tweaking - especially the audio update loop must be robust and without any cpu expensive work or some clicks can occur. Streaming without a separate thread would be impossible.

The code will be committed to the SourceForge cvs in a few days - I am waiting a commit from my partner.

No comments: