# Mute all sounds in Unity

**URL:** <https://qa.fmod.com/t/mute-all-sounds-in-unity/13136>\
**Category:** Unity\
**Created:** [April 26, 2017, 8:52am UTC](https://qa.fmod.com/t/mute-all-sounds-in-unity/13136 "2017-04-26T08:52:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwysocki](https://avatars.discourse-cdn.com/v4/letter/w/919ad9/32.png) [@wwysocki](https://qa.fmod.com/u/wwysocki)\
**Post date:** [April 26, 2017, 8:52am UTC](https://qa.fmod.com/t/mute-all-sounds-in-unity/13136/1 "2017-04-26T08:52:58Z")

</div>

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 ☹

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/](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?**

---

<div class="post-metadata">

**Author:** ![JohannesD](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@JohannesD](https://qa.fmod.com/u/JohannesD)\
**Post date:** [April 26, 2017, 12:34pm UTC](https://qa.fmod.com/t/mute-all-sounds-in-unity/13136/2 "2017-04-26T12:34:19Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![JohannesD](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@JohannesD](https://qa.fmod.com/u/JohannesD)\
**Post date:** [April 26, 2017, 12:35pm UTC](https://qa.fmod.com/t/mute-all-sounds-in-unity/13136/3 "2017-04-26T12:35:55Z")

</div>

> [@](#):
>
> 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 🙂

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

---

<div class="post-metadata">

**Author:** ![wwysocki](https://avatars.discourse-cdn.com/v4/letter/w/919ad9/32.png) [@wwysocki](https://qa.fmod.com/u/wwysocki)\
**Post date:** [April 26, 2017, 12:41pm UTC](https://qa.fmod.com/t/mute-all-sounds-in-unity/13136/4 "2017-04-26T12:41:56Z")

</div>

Another workaround, thanks! It works indeed 🙂

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [April 26, 2017, 10:25pm UTC](https://qa.fmod.com/t/mute-all-sounds-in-unity/13136/5 "2017-04-26T22:25:22Z")

</div>

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);
    }
```

---

<div class="post-metadata">

**Author:** ![wwysocki](https://avatars.discourse-cdn.com/v4/letter/w/919ad9/32.png) [@wwysocki](https://qa.fmod.com/u/wwysocki)\
**Post date:** [April 27, 2017, 6:25am UTC](https://qa.fmod.com/t/mute-all-sounds-in-unity/13136/6 "2017-04-27T06:25:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pmduda](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/pmduda/32/807_2.png) [@pmduda](https://qa.fmod.com/u/pmduda)\
**Post date:** [September 13, 2019, 2:21pm UTC](https://qa.fmod.com/t/mute-all-sounds-in-unity/13136/7 "2019-09-13T14:21:27Z")

</div>

I know this is old, but if the problem is only in Unity Editor, then it is caused by RuntimeManager Update function, which calls `MuteAllEvents(UnityEditor.EditorUtility.audioMasterMute);`

So to mute sounds in Unity Editor, you need to do sth like this:

```auto
#if UNITY_EDITOR
UnityEditor.EditorUtility.audioMasterMute = true;
#else
RuntimeManager.MuteAllEvents(true);
#endif

```
