Skip to content

Commit 3b66574

Browse files
committed
VoiceRecordings: honor advanced audio processing settings
Audio processing settings introduced in matrix-org#8759 is now taken into account when recording a voice message. Signed-off-by: László Várady <[email protected]>
1 parent 40cbee6 commit 3b66574

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/audio/VoiceRecording.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ export class VoiceRecording extends EventEmitter implements IDestroyable {
9393
this.recorderStream = await navigator.mediaDevices.getUserMedia({
9494
audio: {
9595
channelCount: CHANNELS,
96-
noiseSuppression: true, // browsers ignore constraints they can't honour
9796
deviceId: MediaDeviceHandler.getAudioInput(),
97+
autoGainControl: { ideal: MediaDeviceHandler.getAudioAutoGainControl() },
98+
echoCancellation: { ideal: MediaDeviceHandler.getAudioEchoCancellation() },
99+
noiseSuppression: { ideal: MediaDeviceHandler.getAudioNoiseSuppression() },
98100
},
99101
});
100102
this.recorderContext = createAudioContext({

0 commit comments

Comments
 (0)