Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Muting sounds and music  (Read 2746 times)

0 Members and 1 Guest are viewing this topic.

RumpNissen

  • Newbie
  • *
  • Posts: 2
    • View Profile
Muting sounds and music
« 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.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Muting sounds and music
« Reply #1 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Muting sounds and music
« Reply #2 on: February 26, 2014, 03:06:49 pm »
To mute all sounds, loop through them all and call setVolume(0); on each of them.