Mix_PlayMusic loops

Hi List!

When I use

music = Mix_LoadMUS(“music.wav”);
Mix_PlayMusic(music, 5);

to play some music for say five times (or also indefinate times) similar
to the way shown in the SDL_mixer Tutorial, I notice that after each
loop there is a short pause before the music starts playing again.
This I find rather annoying, because the music piece is designed to be
played in an endless loop.
The yiff sound server e.g. does not have this problem.
Am I doing something wrong and is there a short and easy way out of this
(except of continuing to use the yiff instead of SDL)?
Thanks for any advice, Johannes Prix.

Hi List!

When I use

music = Mix_LoadMUS(“music.wav”);
Mix_PlayMusic(music, 5);

to play some music for say five times (or also indefinate times) similar
to the way shown in the SDL_mixer Tutorial, I notice that after each
loop there is a short pause before the music starts playing again.

I looked at the SDL_mixer code (and cleaned it up) and what’s happening
is that the music code is designed to work with a wide variety of backends
which do not support looping. What you want is looping at the sample level.
You can do this with SDL_mixer either by playing the music as a chunk and
specify the looping there. If you really need it to be dynamically
streamed from disk, you can modify the wavestream music backend to do
looping directly.

If you decide to modify SDL_mixer, please grab the latest CVS snapshot:
http://www.libsdl.org/cvs/SDL_mixer-1.2.4.tar.gz

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment