demo · v141
Music Lesson
The W3C explainer's canonical use case. A student is on an RTC call with their teacher, singing along to a backing track playing locally. Default echo cancellation suppresses everything the system plays — including the backing track — so the teacher only hears the voice. echoCancellationMode: "remote-only" tells the AEC to suppress only the teacher's incoming audio, letting the music through.
echoCancellation and silently ignore the new mode values. Use the support probe below to confirm.
Pick a mode, click open mic, and the configured MediaTrackSettings appear below. The level meter shows live mic input — sing or play audio next to the device to confirm.
the call
// "remote-only" — strip incoming RTC audio from mic, keep local music
const stream = await navigator.mediaDevices.getUserMedia({
audio: {
echoCancellation: true,
echoCancellationMode: "remote-only",
},
});
const settings = stream.getAudioTracks()[0].getSettings();
// settings.echoCancellationMode === "remote-only" if applied,
// undefined or "all" on older browsers.
why this angle
The mediacapture-main explainer leads with this exact scenario because it's the clearest demonstration of the gap in the boolean API. echoCancellation: true aggressively suppresses any system playout that loops back through the mic — desirable for normal calls, catastrophic for music tutoring, karaoke, podcasting with a background track, or any app where local audio is part of the show. remote-only draws the AEC boundary at the peer connection.