SDL_mixer question on music change

Hello all,

I’m wondering what the best way is to implement the following:

Say you’re walking around in an enviroment, and you’re listening to your
nice background music playing along.
Suddenly, you either wonder to a dangerous area, or bad guys spawn, or
something equaly terrible happens.
You want to blend from your nice background music, to a tune that is
slightly more up beat.

With multiple music channels it just becomes a case of fade your nice tune
out, while at the same time you fade in your up beat tune.

With SDL_mixer (i.e. 1 music channel), what’s the best way to do implement
this?

cheers,
k.

Kostas Kostiadis <kos climaxgroup.com> writes:

With
SDL_mixer (i.e. 1 music channel), what’s the best way to do implement
this?

Mix the first measure or two as an .OGG file and play the .OGG file through a
regular sound effect channel. While that is playing then load in the rest of
the song and have it ready to play as soon as the sound sample ends.