From e8a2d1f2c9fe013cec1815f3621bd21b7931ec2a Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 7 Dec 2021 00:21:55 -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 3a8c70dc5d07..eda90b743627 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!'