Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e31ad0e

Browse files
committed
Don't specify sample rates for voice messages
Turns out the browser doesn't actually resample for us, instead opting to explode in sadness. We'll leave the resampling to the opus encoder. Fixes element-hq/element-web#16775
1 parent 75bfaa5 commit e31ad0e

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/voice/VoiceRecorder.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,13 @@ export class VoiceRecorder {
5151
private async makeRecorder() {
5252
this.recorderStream = await navigator.mediaDevices.getUserMedia({
5353
audio: {
54-
// specify some audio settings so we're feeding the recorder with the
55-
// best possible values. The browser will handle resampling for us.
56-
sampleRate: SAMPLE_RATE,
5754
channelCount: CHANNELS,
5855
noiseSuppression: true, // browsers ignore constraints they can't honour
5956
deviceId: CallMediaHandler.getAudioInput(),
6057
},
6158
});
6259
this.recorderContext = new AudioContext({
6360
latencyHint: "interactive",
64-
sampleRate: SAMPLE_RATE, // once again, the browser will resample for us
6561
});
6662
this.recorderSource = this.recorderContext.createMediaStreamSource(this.recorderStream);
6763
this.recorderFreqNode = this.recorderContext.createAnalyser();

0 commit comments

Comments
 (0)