-next-
Sound

While SDL has an API that is designed for a low level software audio mixer, the excellent mixer library is much easier to use, and supports numerous sound formats, including WAV sound samples, and MOD and MIDI music files.

First, you initialize the mixer library and open your audio device:

if (Mix_OpenAudio(frequency, format,
                  channels, chunksize) < 0)
  {
    fprintf(stderr, "Can't open audio: %s\n",
            SDL_GetError());
    exit(1);
  }