Playing MP3's

I checked out smpeg recently, thinking that it might have been what
I’m looking for, but I don’t think it is. So, I thought I’d pose a
question here.

Basically, I’m working on a game using SDL. The game doesn’t use any
video features, but it uses audio, and it may use netlib one day. So,
I’m using SDL mainly as a cross-platform sound/network/maybe threads
API.

Anyhow, for this game, I’d like to be able to store sounds as MP3’s,
since they’re much smaller than most other file formats. Is there some
way to play MP3’s using SDL? I’m not very familiar with the audio API
yet; is there some way to use another library to convert the MP3 into
raw sound and pass that to SDL, assuming there are no methods for
supporting MP3’s directly under SDL? Also, am I correct in assuming
that smpeg isn’t for me, since it appears to be designed for movies?
Or, is it possible to play MP3’s using smpeg?

Thanks.

Anyhow, for this game, I’d like to be able to store sounds as MP3’s,
since they’re much smaller than most other file formats. Is there some
way to play MP3’s using SDL? I’m not very familiar with the audio API
yet; is there some way to use another library to convert the MP3 into
raw sound and pass that to SDL, assuming there are no methods for
supporting MP3’s directly under SDL? Also, am I correct in assuming
that smpeg isn’t for me, since it appears to be designed for movies?
Or, is it possible to play MP3’s using smpeg?

I talked to the maintainer of SMPEG, and he said that it would be fairly
easy to shunt an MP3 stream to the splay portion of the player, but it
doesn’t currently support it. SMPEG doesn’t use SDL audio at the moment
either, since that portion already worked when we started.

Once upon a time, I ported mpg123 to SDL and it was about an afternoon
of work which I have since lost, so that might be the way to go for a
free game.

We’re working on a game which uses MP3’s for music, so I’ll be working
on a free LGPL’d decoder based on SDL which uses the MP3 reference release
code. If anyone has any hints on optimization, that would be great. :slight_smile:
I have no idea when this will be ready for public use, but I’ll include
it in the SDL demos when it is. :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

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