-next-
Sound

Now we can load WAVE audio samples and MOD music files to play later on:

Mix_Chunk * sample;
Mix_Music * song;

sample = Mix_LoadWav(file);
song = Mix_LoadMUS(file);

When we want to play a sound, we just use Mix_PlayChannel():

Mix_PlayChannel(channel, sample, loops);

Where channel is a number between 0 and (MIX_CHANNELS - 1). (MIX_CHANNELS is 8 by default, so you can play up to 8 WAVEs simultaneously.) If you use -1, it will pick a free channel for you.

loop is the number of times you want the sample to repeat. (-1 to repeat the sound infinitely.)