Tell Chromium not to change gain during recording

This commit is contained in:
Scott Nonnenberg 2021-12-08 16:28:31 -08:00 committed by GitHub
parent 201845c56a
commit 32756f57d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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!'