Open AL and mp3's

Started by
12 comments, last by Karg 19 years, 4 months ago
Well, i was listening to some of my music the other day, and i decided it would be pretty cool to put some of my music to my games, and of course, that left me with a few options, im using openAL, and alut gives you wav loading right off the bat, which is pretty cool considering ive been unable to find a description of the file format. But of course, a wav of a song would be... huge... to say the least, so i was wondering if anyone knows where either of these things are: a mp3 loader for openAL (actually, as long as it returns the right information, the intended API doesnt matter) or a description of the mp3 file format thanks -Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Advertisement
For a description, just goto Wotsit

For a library, FMOD is highly famous.
You can probably find an mp3 decoding library around the place which can produce a raw PCM data stream for OpenAL, however I wouldnt bother, MP3 has licencing requirements and I'm not even sure if they are wavied for free projects, certainly not for ones you charge for.

Also, if you ever plan to charge money for a project FMOD costs cash as well [smile]

Instead, I'd look into Ogg-Vorbis, its a free file format for compressed files much like mp3 (infact, at lower bit rates its better than MP3) and has other features (and has just hit V1.0 it seems).
There are even not one but two tutorials on getting it going with OpenAL
Quote:Original post by _the_phantom_
You can probably find an mp3 decoding library around the place which can produce a raw PCM data stream for OpenAL, however I wouldnt bother, MP3 has licencing requirements and I'm not even sure if they are wavied for free projects, certainly not for ones you charge for.

Also, if you ever plan to charge money for a project FMOD costs cash as well [smile]

Instead, I'd look into Ogg-Vorbis, its a free file format for compressed files much like mp3 (infact, at lower bit rates its better than MP3) and has other features (and has just hit V1.0 it seems).
There are even not one but two tutorials on getting it going with OpenAL


They do charge money for using MP3 technology in free game projects. I sent the company who holds the license an e-mail and asked them this question myself, so I would definitely stay away from using MP3s in your game, unless you are willing to cough up $2,000 to license the technology.


I use OGG Vorbis in my game and it works great. Its just as good (if not better) than MP3s in terms of quality and compression. I also recommend you use that format for your game.

Hero of Allacrost - A free, open-source 2D RPG in development.
Latest release June, 2015 - GameDev annoucement

for some reason i was under the impression that the liscense only cost money if you're ENCODING not decoding, but of course... ive been wrong before :-D. I might look into ogg, i just remember at one time i was having a hell of a time looking for an mp3-> ogg converter, i think i ended up with a 30 day trial of something


anywho, thanks
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
tbh, mp3=>ogg conversion isnt a great idea, both systems use a slightly different method of removing the redundant data, so as they are both lossy the mp3 would remove one lot, the ogg would remove another can it could end up sounding quite bad
MP3 -> OGG is definitely a bad idea. You need to take the original PCM data and convert that to OGG format. Like the phantom said, those two formats use different compression schemes. They remove different sets of data, so if you convert from WAV to MP3 then it removes data X. Following that, you convert from MP3 to OGG, it removes data Y. So you get craptacular sound quality.
hi, i never coded before in c++ (learning) and i was going to make adding ogg vorbis to a game engine as my first project, but as i unravel whats to be done i see a lot. i have a little question for ya guys. ogg takes up some cpu to decode right? but how much exactly. because if i play many tracks at the same time and using lots of cpu won't be good. i saw that some people got the ipod to play ogg with 87% realtime on a linux kernel(that runs on the ipod) ...
Hmmmm, strange things have been said in this topic.
In my current project I use FMOD (which comes with mp3 support and is free for non commerical use) and I'm planning to load and play mp3 sounds and music. From what Phantom and Roots have said it looks that I should pay license fee for using mp3. Is this correct (if yes, then OMG... :-/ ) or have I just not properly understood your posts and you meant ie. plugin for OpenAL for loading mp3...?
Right, I've just had a shifty about the place and apprently if you shift less than 5000 copies of a game then you dont have to worry about licensing.

This page has all the details.

Personally, I'd be inclinded to just use Ogg anyways and not have to worry [smile]

This topic is closed to new replies.

Advertisement