diff --git a/examples/dialTone.js b/examples/dialTone.js index adbbd26acb..eb1fc5ec1c 100644 --- a/examples/dialTone.js +++ b/examples/dialTone.js @@ -13,17 +13,24 @@ // setup the local sound we're going to use var connectSound = SoundCache.getSound("file:///" + Paths.resources + "sounds/hello.wav"); var disconnectSound = SoundCache.getSound("file:///" + Paths.resources + "sounds/goodbye.wav"); +var micMutedSound = SoundCache.getSound("file:///" + Paths.resources + "sounds/goodbye.wav"); // setup the options needed for that sound -var connectSoundOptions = { +var soundOptions = { localOnly: true }; // play the sound locally once we get the first audio packet from a mixer Audio.receivedFirstPacket.connect(function(){ - Audio.playSound(connectSound, connectSoundOptions); + Audio.playSound(connectSound, soundOptions); }); Audio.disconnected.connect(function(){ - Audio.playSound(disconnectSound, connectSoundOptions); + Audio.playSound(disconnectSound, soundOptions); +}); + +AudioDevice.muteToggled.connect(function () { + if (AudioDevice.getMuted()) { + Audio.playSound(micMutedSound, soundOptions); + } });