GP2X How To Play A Mp3 With Sdl


sdl_mixer uses smpeg to play mp3s, and it's possible the compile of sdl_mixer you're using has been built without smpeg. If you want to play an mp3 you'd be much better off using libmad instead as that is designed for systems without an fpu like the gp2x. Or if you want to stick with sdl_mixer use oggs instead.
 
I use MODs .. nice and low overhead and size :) But all the musicians I know get really mad when you bring up writing MODs :p

jeff
 
yeah i had considered that, gonna see how mp3s go 'cause i want to be able to let people use their own music... but if it doesn't work out, do you know of a library that allows more control of the playing of mods, e.g. direct acces to the stream data, or just the ability to speed up/down, change pitch etc?
 
yeah i had considered that, gonna see how mp3s go 'cause i want to be able to let people use their own music... but if it doesn't work out, do you know of a library that allows more control of the playing of mods, e.g. direct acces to the stream data, or just the ability to speed up/down, change pitch etc?

I would seriously consider converting your mp3 to ogg. It's an open source format that is infinitely better supported by linux and things like SDL. A lot more portable, and completely free of license dramas.
 
Last edited by a moderator:
well, in linux you can use the libmikmod, wich is capable of playing MODs and also IT, S3M and XM, so you won't be bothered by limitations of the genuine MOD standard

I think mod-wise files are best for background music, the only bad thing is that it cannot have much voice recording (unless you plan to build a 20mb mod file)

for voice I would suggest mp3 with mad (faster by using no FP calculations) or ogg for size/quality dependence
 
How much CPU load does playing an ogg or mp3(libmad) take? ie: 80% of the cpu, or 20%?

jeff

Well, in Stargazer engine tests, playing a 96kbps OGG Vorbis file drops framerate from about 140 to 115. Fairly large hit but percentagewise, not too bad. 96KBps Vorbis sounds excellent anyway-- you might be able to tolerate less especially if you use the speakers!

Bear in mind though I am using the non-floating point heavy "Tremor" OGG Vorbis decoding library. Standard OGG decoding with lots of floating point code won't be too fast.
 
Last edited by a moderator:
Back
Top