fix: auto-disable AEC during screen share to prevent Chrome voice ducking

Chrome's AEC uses getDisplayMedia audio as a reference signal and
aggressively ducks the microphone even when headphones are used.
This adds a screenShareActive flag to AudioManager that forces
echoCancellation off during screen share, plus Chromium-specific
goog* constraints as belt-and-suspenders.
This commit is contained in:
Jannis Braun
2026-02-20 15:22:20 +01:00
parent 25f72aef3b
commit 708bdf5468
7 changed files with 56 additions and 6 deletions
@@ -127,13 +127,13 @@ export function UserSettingsModal() {
Voice Processing
</h3>
<p className="text-xs text-discord-text-muted mb-3">
Disable Auto Gain Control when streaming to prevent your browser from ducking your microphone.
Echo Cancellation is automatically disabled while you screen share to prevent Chrome from ducking your mic volume.
</p>
<div className="flex items-center justify-between py-2">
<div>
<div className="text-sm text-discord-text-primary">Echo Cancellation</div>
<div className="text-xs text-discord-text-muted">Removes echo when using speakers</div>
<div className="text-xs text-discord-text-muted">Removes echo when using speakers (auto-disabled during screen share)</div>
</div>
<button
onClick={() => setEchoCancellation(!echoCancellation)}