How to Mute / Unmute audio after WaitForSeconds()

I want to mute another AudioSource on another gameObject while I play a soundEffect and once that soundEffect has finished playing the music will unmute. How would I script that?

Thanks for any help it will be really appreciated thanks.

you can pause it or mute it: AudioSource.Pause & AudioSource.mute:

http://docs.unity3d.com/Documentation/ScriptReference/AudioSource.Pause.html

http://docs.unity3d.com/Documentation/ScriptReference/AudioSource-mute.html

EDIT:

here’s an example:

(javascript)

    var otherObject : GameObject;
    
    function Start(){
    otherObject = GameObject.Find("NameOfObject");
    }
    
    function PlaySound(){
    otherObject.audio.mute = true;
    audio.Play();
    while(audio.isPlaying){
    yield;
    }
    otherObject.audio.mute = false;
    }

I think this should do it

(edit again)
Oops, looks like you’re using C#, so like this I think:

    private GameObject otherObject;
    
    void Start(){
    otherObject = GameObject.Find("NameOfObject");
    }
    
    IEnumerator PlaySound(){
    otherObject.audio.mute = true;
    audio.Play();
    while(audio.isPlaying){
    yield return 0;
    }
    otherObject.audio.mute = false;
    }

my C# is rusty, but I think this should work