mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 21:12:53 +02:00
Play sound upon microphone being muted
This commit is contained in:
parent
546442ff9a
commit
f0b6b0f548
1 changed files with 10 additions and 3 deletions
|
@ -13,17 +13,24 @@
|
||||||
// setup the local sound we're going to use
|
// setup the local sound we're going to use
|
||||||
var connectSound = SoundCache.getSound("file:///" + Paths.resources + "sounds/hello.wav");
|
var connectSound = SoundCache.getSound("file:///" + Paths.resources + "sounds/hello.wav");
|
||||||
var disconnectSound = SoundCache.getSound("file:///" + Paths.resources + "sounds/goodbye.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
|
// setup the options needed for that sound
|
||||||
var connectSoundOptions = {
|
var soundOptions = {
|
||||||
localOnly: true
|
localOnly: true
|
||||||
};
|
};
|
||||||
|
|
||||||
// play the sound locally once we get the first audio packet from a mixer
|
// play the sound locally once we get the first audio packet from a mixer
|
||||||
Audio.receivedFirstPacket.connect(function(){
|
Audio.receivedFirstPacket.connect(function(){
|
||||||
Audio.playSound(connectSound, connectSoundOptions);
|
Audio.playSound(connectSound, soundOptions);
|
||||||
});
|
});
|
||||||
|
|
||||||
Audio.disconnected.connect(function(){
|
Audio.disconnected.connect(function(){
|
||||||
Audio.playSound(disconnectSound, connectSoundOptions);
|
Audio.playSound(disconnectSound, soundOptions);
|
||||||
|
});
|
||||||
|
|
||||||
|
AudioDevice.muteToggled.connect(function () {
|
||||||
|
if (AudioDevice.getMuted()) {
|
||||||
|
Audio.playSound(micMutedSound, soundOptions);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue