Mp3 music with SDL_mixer

I’m using SDL_mixer to play mp3 music. The music,
however, does not loop.

The same code loops just fine when I feed Mix_LoadMUS()
a .wav file, but mp3s stop playing after the first run.

My code is pretty basic:

Mix_Music *music = Mix_LoadMUS( argv[1] );
Mix_PlayMusic( music, 2 );
sleep( 1000 );

I know that Heroes3 loops mp3s. Anybody know what I’m
missing?

Thanks,
JW–
// John Watson
// Software Engineer – STScI Archive Team

Perhaps the wav-file only loops because it has a loop defined (which
wav-allows), not because of some SDL_mixer-specialty. Mp3, AFAIK,
does not have the option to define loops, or your file does not use this,
if it were possible. That would mean you have to restart playing yourself,
preferably via some end-of-play-callback-function.

HTH,
robOn Sun, Mar 12, 2000 at 08:44:29PM -0500, John Watson wrote:

I’m using SDL_mixer to play mp3 music. The music,
however, does not loop.

The same code loops just fine when I feed Mix_LoadMUS()
a .wav file, but mp3s stop playing after the first run.

John Watson wrote:

I know that Heroes3 loops mp3s. Anybody know what I’m
missing?

Question for the Loki guys: Does Heroes3 use SDL_mixer to
load/play mp3 music, or does it use smpeg directly?

JW–
// John Watson
// Software Engineer – STScI Archive Team

In article <38CC5933.F14F962D at home.com>,
John Watson writes:

John Watson wrote:

I know that Heroes3 loops mp3s. Anybody know what I’m
missing?

Question for the Loki guys: Does Heroes3 use SDL_mixer to
load/play mp3 music, or does it use smpeg directly?

It uses the Mixer to play MP3s, thru SMPEG. Actually the SMPEG support
to the mixer was added for this game :-)–
Stephane Peter
Programmer
Loki Entertainment Software

“Microsoft has done to computers what McDonald’s has done to gastronomy”