SDL_mixer is meant to be a super-simple audio library; a single music track is one of its limitations.
You could play the music as multiple sound effects. There are a few downsides though:
- You'll have to manage pausing/volume/looping yourself, by keeping track of the channels used to play the sounds. Not too difficult, but it's code you have to write.
- The sounds won't be streamed, so all your music tracks will be decoded and loaded into RAM uncompressed. These days uncompressed audio isn't that bad - to calculate uncompressed size, simply multiply
num_channels * sample_rate * bit_rate * duration_in_seconds
, which works out to be2 * 44100 * 2 * 60
or10584000
or ~10mb per minute of stereo, 44.1kHz 16-bit (i.e. 2-byte) audio. It's something to watch out for in embedded or low-end systems.
Alternately, you can use a more advanced audio library that supports multiple music channels.