# How to make an mute/unmute button?

**URL:** <https://qa.fmod.com/t/how-to-make-an-mute-unmute-button/18840>\
**Category:** Unity\
**Tags:** unity\
**Created:** [June 4, 2022, 10:08pm UTC](https://qa.fmod.com/t/how-to-make-an-mute-unmute-button/18840 "2022-06-04T22:08:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nahuel.costa](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nahuel.costa](https://qa.fmod.com/u/Nahuel.costa)\
**Post date:** [June 4, 2022, 10:08pm UTC](https://qa.fmod.com/t/how-to-make-an-mute-unmute-button/18840/1 "2022-06-04T22:08:19Z")

</div>

Hi everyone!  
I want to make a button in unity that mutes/unmutes the music and sfx.  
I have 3 buses for the settings in the game, one for sfx, one for music and the other for the master.  
I thought about making a snapshot that lowers the master vca, but how can I apply it in unity?  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [June 6, 2022, 2:18am UTC](https://qa.fmod.com/t/how-to-make-an-mute-unmute-button/18840/2 "2022-06-06T02:18:08Z")

</div>

You’re on the right track. Assign all the necessary group buses into the necessary VCAs and then use `FMODUnity.RuntimeManager.GetVCA` to get the VCA and `VCA::setVolume()` to set the volume of the VCA (`0` to mute, `1` to set back to default volume level).

[https://www.fmod.com/resources/documentation-unity?version=2.02&page=api-runtimemanager.html#getvca](https://www.fmod.com/resources/documentation-unity?version=2.02&page=api-runtimemanager.html#getvca)

[https://www.fmod.com/resources/documentation-api?version=2.02&page=studio-api-vca.html#studio\_vca\_setvolume](https://www.fmod.com/resources/documentation-api?version=2.02&page=studio-api-vca.html#studio_vca_setvolume)

---

<div class="post-metadata">

**Author:** ![Nahuel.costa](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nahuel.costa](https://qa.fmod.com/u/Nahuel.costa)\
**Post date:** [June 9, 2022, 11:01pm UTC](https://qa.fmod.com/t/how-to-make-an-mute-unmute-button/18840/3 "2022-06-09T23:01:07Z")

</div>

Thanks a lot!!

---

<div class="post-metadata">

**Author:** ![torley-gallium](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/torley-gallium/32/3688_2.png) [@torley-gallium](https://qa.fmod.com/u/torley-gallium)\
**Post date:** [April 11, 2023, 9:28pm UTC](https://qa.fmod.com/t/how-to-make-an-mute-unmute-button/18840/4 "2023-04-11T21:28:34Z")

</div>

@richard_simms I also found your info useful! Is there a practical way to do the opposite with a Solo button, and by that I mean:

- I have various sounds (FMOD events with Programmer Instruments) playing that are in one (or more) mixer groups
- I want to press a button in the game that MUTES all the other sounds, so it should be able to detect what everything else is in a group
- It should not mute certain other mixer groups, such as system UI sounds, and the like.

Basically the in-game equivalent of pressing a SOLO button in an FMOD event track. What might the logic for this look like, or is it considerably trickier?

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [April 13, 2023, 3:55am UTC](https://qa.fmod.com/t/how-to-make-an-mute-unmute-button/18840/5 "2023-04-13T03:55:57Z")

</div>

> [@torley-gallium](#):
>
> I also found your info useful! Is there a practical way to do the opposite with a Solo button, and by that I mean:
> 
> - I have various sounds (FMOD events with Programmer Instruments) playing that are in one (or more) mixer groups
> - I want to press a button in the game that MUTES all the other sounds, so it should be able to detect what everything else is in a group
> - It should not mute certain other mixer groups, such as system UI sounds, and the like.
> 
> Basically the in-game equivalent of pressing a SOLO button in an FMOD event track. What might the logic for this look like, or is it considerably trickier?

Unfortunately, it is a little trickier, as the API has no “Solo” functionality - any implementation of what you want will require some kind of enumeration of buses. This could either be done at design time in Studio, for example by automating bus faders with parameters or setting up VCAs that affect specific buses to the exclusion of other, or at runtime by enumerating your buses with [`Studio::Bank::getBusList`](https://www.fmod.com/docs/2.02/api/studio-api-bank.html#studio_bank_getbuslist) and muting/unmuting as needed with [`Studio::Bus::SetMute`](https://www.fmod.com/docs/2.02/api/studio-api-bus.html#studio_bus_setmute).

---

<div class="post-metadata">

**Author:** ![torley-gallium](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/torley-gallium/32/3688_2.png) [@torley-gallium](https://qa.fmod.com/u/torley-gallium)\
**Post date:** [April 13, 2023, 9:22am UTC](https://qa.fmod.com/t/how-to-make-an-mute-unmute-button/18840/6 "2023-04-13T09:22:30Z")

</div>

Acknowledged and thanks for confirming. I thought as much but didn’t want to assume — so your precise info is valuable!
