Mute all sounds in Unity


#1

Hi,
I have a problem with FMODUnity.RuntimeManager.MuteAllEvents().

I want to mute all sounds on Master Bus “bus:/” and it should work straight away I think. There are no errors in Unity console, no warnings etc.
FMODUnity.RuntimeManager.PlayOneShot() works perfectly. Controlling custom parameters from Unity works great.

Are there any special things to consider while using MuteAllEvents()?

I’ve searched on various sites for solution but found nothing :frowning:

Thanks for any help!

FMOD Studio 1.09.02
Unity 5.5.1f1

edit:
I also tried this based on https://www.fmod.org/questions/question/how-do-you-script-volume-control-for-music-and-sfx-buses/:

string masterBusString = “bus:/”;
FMOD.Studio.Bus masterBus;

masterBus = FMODUnity.RuntimeManager.GetBus(masterBusString);
masterBus.setVolume(float); - works great
masterBus.setPause(bool); - works great
masterBus.setMute(bool); - doesn’t work at all…

So workaround for now is to use masterBus.setVolume(0.0f)/masterBus.setVolume(1.0f) to simulate mute/unmute or just masterBus.setPause(true/false).

The question remains - why setMute() does not work?


#2

Hm, I can’t tell you the problem with the method MuteAllEvents, but I’m using

Bus musicBus = FMODUnity.RuntimeManager.GetBus("bus:/Music");
musicBus.setMute(true);

That works really well. So You could create a masterbus which is the parent of all other buses and just mute that one :slight_smile:


#3

Oh just saw your edit… strange setMute does work for me.
Unity 5.6.0p2
Fmod 1.09.04


#4

Another workaround, thanks! It works indeed :slight_smile:


#5

MuteAllEvents should take a bool parameter for pausing and unpausing.

In the RuntimeManager.cs you can see what MuteAllEvents does:

public static void MuteAllEvents(bool muted)
    {
        GetBus("bus:/").setMute(muted);
    }

#6

Yes, I know this, but it doesn’t work for me as described above. Thanks for your answer anyway :slight_smile: