setEchoCancellation

View as MarkdownOpen in Claude
1setEchoCancellation(enabled): Promise<void>

Toggle echo cancellation on the local mic at runtime. Applied via track.applyConstraints; browsers that don’t honour runtime constraints (notably iOS Safari) fall back to re-acquiring the track with the new constraint set and plumbing the replacement through the local audio pipeline if one is active.

Parameters

enabled
booleanRequired

Whether echo cancellation should be enabled.

Returns

Promise<void> — resolves after the constraint has been applied (via applyConstraints or, on browsers without runtime support, after a track replacement).

Examples

Toggle from a UI switch

1echoSwitch.addEventListener('change', async (e) => {
2 await call.setEchoCancellation(e.target.checked);
3});

See