LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Optus on November 18, 2003, 21:13:03

Title: OpenAL + MP3Player
Post by: Optus on November 18, 2003, 21:13:03
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?
Title: OpenAL + MP3Player
Post by: Matzon on November 18, 2003, 22:44:04
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 (http://www.devmaster.net/articles/openal-tutorials/lesson8.php) (C++) as a basis (using Ogg Vorbis for playback through OpenAL). - you just need to find an mp3 library to decode with (MAD (http://www.underbit.com/products/mad/) comes to mind...)