Mute for SDL_Mixer

I want to implement Mute functionality in my framework. I haven’t found
anything that does it in SDL_Mixer.

  • Setting the music and channels volume to 0 has the problem that I lose the
    previous volume of the channels and music when I want to unmute.

  • Mix_PauseChannel and Mix_PauseMusic don’t have the volume problem, but its
    effect is similar to a PAUSE button, not to a MUTE button.

What’s the canonical/easiest way to implement mute in SDL_Mixer?

–Gabriel

Save the volume(s), set it to zero while muted, then set back to
previous value(s) when unmuted?

-JustinOn Mon, Apr 28, 2008 at 8:22 PM, Gabriel Gambetta wrote:

I want to implement Mute functionality in my framework. I haven’t found
anything that does it in SDL_Mixer.

  • Setting the music and channels volume to 0 has the problem that I lose the
    previous volume of the channels and music when I want to unmute.

  • Mix_PauseChannel and Mix_PauseMusic don’t have the volume problem, but its
    effect is similar to a PAUSE button, not to a MUTE button.

What’s the canonical/easiest way to implement mute in SDL_Mixer?

–Gabriel


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org