From f0a79f52bac611c4e9d6a0dd5bbddf4f33c848c0 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Mon, 1 Mar 2021 15:21:59 +0100 Subject: [PATCH] Fixed microphone attack/release smooth for the native client and made it actually adjustable --- shared/js/settings.ts | 19 +++++++++++++++++++ shared/js/ui/modal/settings/Microphone.tsx | 1 + shared/js/voice/RecorderProfile.ts | 13 ++++++++++--- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/shared/js/settings.ts b/shared/js/settings.ts index 6718b196..bf3c4a6d 100644 --- a/shared/js/settings.ts +++ b/shared/js/settings.ts @@ -778,6 +778,25 @@ export class Settings { valueType: "boolean", }; + static readonly KEY_MICROPHONE_THRESHOLD_ATTACK_SMOOTH: ValuedRegistryKey = { + key: "microphone_threshold_attack_smooth", + valueType: "number", + defaultValue: .25 + }; + + static readonly KEY_MICROPHONE_THRESHOLD_RELEASE_SMOOTH: ValuedRegistryKey = { + key: "microphone_threshold_release_smooth", + valueType: "number", + defaultValue: .9 + + }; + static readonly KEY_MICROPHONE_THRESHOLD_RELEASE_DELAY: ValuedRegistryKey = { + key: "microphone_threshold_release_delay", + valueType: "number", + description: "Delay for the client to cut of the audio in ms.", + defaultValue: 500 + }; + static readonly FN_LOG_ENABLED: (category: string) => RegistryKey = category => { return { key: "log." + category.toLowerCase() + ".enabled", diff --git a/shared/js/ui/modal/settings/Microphone.tsx b/shared/js/ui/modal/settings/Microphone.tsx index 313c3fa5..75f765d9 100644 --- a/shared/js/ui/modal/settings/Microphone.tsx +++ b/shared/js/ui/modal/settings/Microphone.tsx @@ -115,6 +115,7 @@ export function initialize_audio_microphone_controller(events: Registry