mirror of
https://github.com/lubosz/overte.git
synced 2025-04-06 01:02:29 +02:00
Fix halfDuplex script
This commit is contained in:
parent
db2b702221
commit
fba1a8ddaa
1 changed files with 3 additions and 7 deletions
|
@ -20,7 +20,7 @@
|
|||
var averageLoudness = 0.0;
|
||||
var AVERAGING_TIME = 0.9;
|
||||
var LOUDNESS_THRESHOLD = 100;
|
||||
var HYSTERESIS_GAP = 1.41; // 3db gap
|
||||
var HYSTERESIS_GAP = 1.41; // 3dB gap
|
||||
var MICROPHONE_DISPLAY_NAME = "Microphone";
|
||||
|
||||
var debug = false;
|
||||
|
@ -54,17 +54,13 @@ Script.update.connect(function () {
|
|||
print("Muted!");
|
||||
}
|
||||
isMuted = true;
|
||||
if (!AudioDevice.getMuted()) {
|
||||
AudioDevice.toggleMute();
|
||||
}
|
||||
Audio.muted = true;
|
||||
} else if (isMuted && (averageLoudness < LOUDNESS_THRESHOLD)) {
|
||||
if (debug) {
|
||||
print("UnMuted!");
|
||||
}
|
||||
isMuted = false;
|
||||
if (AudioDevice.getMuted()) {
|
||||
AudioDevice.toggleMute();
|
||||
}
|
||||
Audio.muted = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue