From 789f9eb709d6f0cf3e9cdb22282b0279b27f0d1e Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 18 Nov 2018 11:32:16 +0100 Subject: [PATCH] Fixed PPT key assignment --- shared/js/voice/VoiceRecorder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/js/voice/VoiceRecorder.ts b/shared/js/voice/VoiceRecorder.ts index 0c220713..47619dfb 100644 --- a/shared/js/voice/VoiceRecorder.ts +++ b/shared/js/voice/VoiceRecorder.ts @@ -360,8 +360,11 @@ class PushToTalkVAD extends VoiceActivityDetector { } set key(key: ppt.KeyDescriptor) { - Object.assign(this._key_hook, this._key); + ppt.unregister_key_hook(this._key_hook); + Object.assign(this._key, key); + Object.assign(this._key_hook, key); this._pushed = false; + ppt.register_key_hook(this._key_hook); } shouldRecord(buffer: AudioBuffer): boolean {