OpenAL + MP3Player

Started by Optus, November 18, 2003, 21:13:03

Previous topic - Next topic

Optus

In a game I was working on, rather than create some original score for it, I was thinking of including an MP3 player that the user could point to their mp3 files for music (with a few songs included). Anyway, a really easy method that came to me was making a native MP3 player and use JNI.  Would this conflict with OpenAL?  Or, should I do the work to make OpenAL play mp3 format?

Matzon

Theoretically, you could play through some other JNI wrapper. However you could just as easlily load a mp3 file, decode it to a buffer and load it up in OpenAL. Depending on the size of mp3 file, you might have to use queing though.

You could use this tutorial (C++) as a basis (using Ogg Vorbis for playback through OpenAL). - you just need to find an mp3 library to decode with (MAD comes to mind...)