Skip to content

Commit

Permalink
Tell Chromium not to change gain during recording
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Dec 9, 2021
1 parent 58c62a9 commit 89966fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ts/services/audioRecorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!'
Expand Down

0 comments on commit 89966fb

Please sign in to comment.