SFML community forums

Help => Audio => Topic started by: RumpNissen on February 26, 2014, 02:54:43 pm

Title: Muting sounds and music
Post by: RumpNissen on February 26, 2014, 02:54:43 pm

Well, since I got my sound manager to work. I've been trying to figure out a way to have a function that dynamically mutes all sounds and music.

See, I'm making a main menu with an options tab where you can mute the sounds and music separately. I have no idea where to start, since no one else seems to have tried doing the same thing. I guess it needs to be done through the sound manager.

Any ideas? Do I need to upload the code for the sound manager?

Any advice would be much appreciated.
Title: Re: Muting sounds and music
Post by: Nexus on February 26, 2014, 03:04:19 pm
You can set the volume to zero, or better, not even play them when they're muted, to not waste processing power.
Title: Re: Muting sounds and music
Post by: Jesper Juhl on February 26, 2014, 03:06:49 pm
To mute all sounds, loop through them all and call setVolume(0); on each of them.