fix: use remote-only echo cancellation for microphone

Use Chrome/Edge's 'remote-only' echo cancellation mode to allow
microphone input during local system audio playback while still
preventing acoustic echo from remote sources in video calls
This commit is contained in:
rishikanthc
2025-12-25 16:30:05 -08:00
committed by Rishikanth Chandrasekaran
parent 76d92e2055
commit ca2ed2fd72

View File

@@ -312,7 +312,8 @@ export function SystemAudioRecorder({
mStream = await navigator.mediaDevices.getUserMedia({
audio: {
deviceId: selectedDevice ? { exact: selectedDevice } : undefined,
echoCancellation: true, // CRITICAL: Prevent mic from capturing system audio output
// @ts-expect-error - Chrome/Edge support "remote-only" for echo cancellation
echoCancellation: "remote-only", // Only cancel remote echo, allow mic during local playback
noiseSuppression: true, // Remove background noise
autoGainControl: true, // Normalize volume levels
},