Using MP3s instead of WAVs for SDL_mixer samples?

Hi everyone,

Can the eight samples which SDL_mixer is capable of playing be MP3s
instead of WAVs? I know that the additional background music channel
can be MP3 (as well as MID, MOD, S3M, IT and XM, or WAV) but would like to
take advantage of the excellent compression of the MP3 format for
sound samples. I believe the answer is, “no, only the background
music can be MP3” but want to doublecheck this…

Assuming the sound samples cannot be MP3, is there a facility in
SDL, SDL_mixer, or smpeg to convert an MP3 to a raw buffer, which
could then be used as one of the sound samples for SDL_mixer? Again,
I really want to store sound samples as MP3s, and then either use
them directly, or uncompress them to a buffer usable by SDL.

My application will very likely have minimal permanent storage (maybe
a small flash HDD) but should have sufficient CPU power to decode
several MP3s simultaneously, or at least sufficient RAM to decode
MP3s once and store them in a buffer for use by SDL_mixer, assuming
there is a facility to do that. My main goal is to reduce the impact
on the HDD by storing MP3s instead of WAVs…

Thanks for any suggestion, ideas or URLs,

Steve Madsen
H2Eye Ltd.
24-28 Hatton Wall
London EC1N 8JH
UNITED KINGDOM (UK)
Tel: +44 (0) 207 404 9600
Fax: +44 (0) 207 404 9490
Email: @Steve_Madsen

Hi all,

Is anyone able to loop MP3s using playmus from SDL_mixer-1.0.5?

I am simply using this command:

 $ playmus -l mymus.mp3

but do not get the expected looping behavior. The first time through,
the mp3 will play perfectly, but after that it either hangs or quits
(depending on the length of the mp3 file it seems).

Thanks,

Hi all,

Is anyone able to loop MP3s using playmus from SDL_mixer-1.0.5?

I am simply using this command:

 $ playmus -l mymus.mp3

but do not get the expected looping behavior. The first time through,
the mp3 will play perfectly, but after that it either hangs or quits
(depending on the length of the mp3 file it seems).

It’s a bug in SMPEG. It will be fixed in the next release.

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec