Advertisement

Does openal play mp3?

Started by March 07, 2004 10:26 PM
3 comments, last by innuendo 20 years, 8 months ago
Hi! I want to play mp3 files with openal for background track. But how can I do that. At the moment I play .wav. I''m trying to load mp3 to get several minutes in the sound track with out that memory impact. Is that the way for large background musics in game or there is another memory friendly way to handle it with openal? Any comment will be welcome!
Decode the MP3 into PCM data using some MP3 decoding library. To stream it, take advantage of OpenAL''s buffer queue. When the data remaining to be played starts to run low, load and decode some more data and queue it (possibly using another thread to monitor and handle that). I''m relatively sure there''s a couple streaming-with-OpenAL tutorials around, combine them with whatever MP3 decoding library you learn to use.

Advertisement
Of course, the hard part is decoding the MP3 into PCM, since you need a license to do that, and they are rather costly.

Might want to look into Ogg Vorbis.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
For games, the going rate for using MP3 is $2,500 per title.

http://www.mp3licensing.com/royalty/

Now, I''m not suggesting that it is thoroughly evil to obtains patents on a system, make it available royalty-free, wait until the system is widely used, and then start demanding royalties. But I wouldn''t use MP3.
CoV
Can any of you suggest me any mp3 decoder library?

I''m currently moving into Ogg Vorbis but I want to take a point in mp3 too.

Thanks in advance

This topic is closed to new replies.

Advertisement