- Home /
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 :D
Answer by DaveA · Aug 27, 2012 at 07:15 PM
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.
Ok Thanks, i had a feeling that I'd have to create two gameObjects.
Thanks for your reply it has worked but how would you mute and unmute an audiosource from a different gameobject :D
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Muting Audio 2 Answers
Activating Audio When Hitting a collider 2 Answers
Inconsistent ReverbZone / AudioSource.volume behavior 2 Answers
Getting Unity to listen to desktop audio 2 Answers