Automatic WhatsApp Audio Ducking
Lowers the volume of chosen apps (e.g. Spotify) while WhatsApp or other apps play audio, then restores it
Author: wa0dim
While WhatsApp or other chosen apps (voice messages, videos, calls' media, ...) produce sound, the
per-app volume of the configured target apps (default: Spotify) is lowered to
a fixed percentage. When WhatsApp or the specified apps have been silent for a short moment, the
original volume is restored.
This only changes the per-app volume slider of the Windows volume mixer, not
the system volume.
Choosing messengers
In the settings under "Messengers" you can switch on WhatsApp (default),
Telegram, Signal, Discord, Microsoft Teams, Zoom, Slack, Viber and Element.
Any other app can be added by its process name under "Additional trigger apps"
(e.g. Threema.exe).
Calls
Windows lowers other apps by itself during calls (communication streams) unless
"Do nothing" is selected in the Sound control panel (Communications tab). The
mod detects such calls via the Windows ducking notification and stays out of
the way, so the volume is not lowered twice (changeable with "Also duck calls
that Windows already ducks"). If a call is not flagged by Windows but a
selected messenger has an open microphone stream, the mod ducks for the whole
call, also between ringtones and beeps. The log shows who handles the call.
Notes
- Messengers are detected by process name. Audio from
msedgewebview2.exe
helper processes started by a selected messenger counts as well; other child
processes (e.g. a browser opened from a link) do not.
- If nothing happens, check the Windhawk log: the mod logs the process name of
every audio session it sees when a new one appears.
- If you change the volume of a target app yourself while it is ducked, your
value is taken as the new "original" volume.
- All active playback devices are handled.
- The mod only works while audio is involved: it waits for Windows audio events
and does not poll while no trigger app has an open audio stream.
- Windows remembers the volume of each app. While an app is ducked, the mod
keeps a record of its original volume in Windhawk's storage, so the volume is
restored after a restart of the mod, a closed and reopened app or a changed
playback device. If an app stays closed while the mod is turned off, Windows
can keep its lowered volume until you raise it in the volume mixer.
Warning:
I used AI (Claude Sonnet 5.5) to create this mod. I am not responsible for any damage using this mod may cause. Use at your own risk.
However I did ask Claude to check for security vulnerabilities.