From 89966fba47f8548031e365edb05e55e88dde4034 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Wed, 8 Dec 2021 16:29:50 -0800 Subject: [PATCH] Tell Chromium not to change gain during recording --- ts/services/audioRecorder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts/services/audioRecorder.ts b/ts/services/audioRecorder.ts index 3a8c70dc5..eda90b743 100644 --- a/ts/services/audioRecorder.ts +++ b/ts/services/audioRecorder.ts @@ -68,7 +68,10 @@ export class RecorderClass { this.recorder.onError = this.onError.bind(this); try { - const stream = await navigator.mediaDevices.getUserMedia({ audio: true }); + const stream = await navigator.mediaDevices.getUserMedia({ + // @ts-expect-error Typescript doesn't know about these important options + audio: { mandatory: { googAutoGainControl: false } }, + }); if (!this.context || !this.input) { const err = new Error( 'Recorder/getUserMedia/stream: Missing context or input!'