Tell Chromium not to change gain during recording

This commit is contained in:
Scott Nonnenberg
2021-12-07 00:21:55 -08:00
committed by GitHub
parent b1ebc0f483
commit e8a2d1f2c9

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