How to Mute/Unmute audio while another audio plays?

In my project I have a Speaker gameObject and in this object I want to play music when I press the ‘M’ key and play a sound effect when I press the ‘F1’ key, but I want the music’s volume to mute and the sound effect to play, then once the sound effect has finished playing, the music’s volume will unmute.

Thank for any help :smiley:

Assuming you don’t want the music to pause but keep playing silently, you could just use 2 AudioSources (on different GameObjects) and mute the music one.