🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Using MP3 files in OpenGL programs

Started by
9 comments, last by steve_bruce 24 years ago
I noticed in one of NeHe''s projects (the xmas one) that he was using an mp3 music file. My question is quite simple. How?????
Advertisement
Good question... I too wouldn''t mind knowing the answer...

Protozone
He probably used an addon library that decoded the mp3''s. Such libraries are Bass, GAudio, and Fmod. There are many more but I don''t remember most of them. Just about all of them have a license where you can use their product free for freeware use, but must pay A LOT of money if you plan to sell it. Find me a freeware mp3 decoding library and i''ll be a happy man.
Joe
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
I have FMod and i think it''s free , so i''m using it in my projects
A word of warning to all you people thinking of using MP3s for real-time games: mp3 decoding will slow your game down a lot. Unless you''re getting over 150fps, I wouldn''t bother.

Hardware MP3 decoding would be nice though

http://www.geocities.com/ben32768

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

quote: Original post by benjamin bunny

>Hardware MP3 decoding would be nice though

I have the Creative Labs Sound Blaster Live MP3+ which does hardware MP3 decoding. When I am programming I listen to my Mp3''s and there is very little impact on performance.

I think that shipping audio in Mp3 format and decompressing it into a wav cache for unaccelerated cards would be the best option, but also support accelerated cards like the Mp3+.

Of course, the only card I know of that does hardware Mp3 is the Mp3+, hopefully if more manufacturers add support they''ll use the same API.
Where do you get these mp3 decoding library''s from? Like that FMod.

i agreee with benjimin. dont use mp3 in a game because decodeing a mp3 file takes 10% of ure processor time which could be better used doing somn else.

~prevail by daring to fail~
To mr anonymous
the SB Live MP3+ does NOT accelerate MP3 (de)compression with hardware, you only pay for a bunch of programs, the hardware is identical to other versions

and:
It is not very wise to decompress to wav to save about 5%CPU time
1)takes 12 times as much memory
2)takes a lot of time to start up
I'' have AMD K6-2/350 in a noname motherboard with Creative SB AWE64. On my machine the mp3 decoding costs 6& of the CPU time. It'' not much for turn-based games or other low CPU using games. You have to decide it is suitable for you. There are other solutions for save the disk space, like ADPCM compression. This have good quality and lesser than the original wave.

This topic is closed to new replies.

Advertisement