This project is similar to Discord Global Attenuation, except any sound source can be selected as the priority source.
A Windows system tray application that provides global hotkeys for audio control of the active window's application, with a comprehensive UI for settings and manual control.
- Instantly mute/unmute the currently active window's application
- No more fumbling through the Windows volume mixer
- Works with any application that has an audio session
- Designate the active window as the "priority application"
- When the priority app plays audio, all other applications are automatically ducked to 15% volume (configurable)
- When the priority app stops playing audio, all other apps are restored to their original volume levels
- Perfect for:
- Voice calls (Discord, Teams, Zoom) - automatically duck music/games
- Watching videos while gaming - auto-duck game audio when video plays
- Streaming - ensure your voice is always heard over other apps
-
Status & Control Tab:
- Real-time view of all audio sessions
- See current volume levels for each app
- Visual activity meters showing which apps are playing audio
- Priority mode status indicator
- Manual priority mode activation buttons for each app
- Highlight showing which app is the priority app
-
Settings Tab:
- Adjust ducked volume percentage (1-50%)
- Configure audio monitoring interval (100-1000ms)
- Set notification duration (500-3000ms)
- View active hotkeys
-
Access the UI:
- Double-click the system tray icon
- Right-click → "Show Control Panel"
- Run
ActiveWindowMuteToggle.exe - The app runs in the system tray
- Use the hotkeys:
- Ctrl+Alt+M: Toggle mute for the active window's app
- Ctrl+Alt+P: Toggle priority mode for the active window's app
- Double-click the tray icon to open the Control Panel
From the Control Panel's Status & Control tab:
- Click "Set Priority" next to any app to enable priority mode for that app
- The priority app is highlighted in yellow
- Click "Remove Priority" on the priority app to disable priority mode
- Click "Set Priority" on a different app to switch priority apps
- Priority mode indicator shows ON/OFF status with a green/gray dot
The project is organized into modular components:
- ActiveWindowMuteToggle.cs - Main entry point
- Settings.cs - Configuration with runtime modification support
- WindowHelper.cs - Win32 API calls for window management
- AudioSessionHelper.cs - NAudio wrapper for audio session management
- AudioSessionViewModel.cs - ViewModel for UI data binding
- MuteFeature.cs - Mute toggle functionality
- PriorityModeFeature.cs - Priority mode with automatic volume ducking
- HotkeyForm.cs - Global hotkey registration and handling
- TrayApplicationContext.cs - System tray icon and application lifecycle
- MainWindow.xaml/.cs - WPF UI for settings and status
You can modify settings from the Settings tab in the UI:
- Ducked volume level: 1-50% (default: 15%)
- Audio monitoring interval: 100-1000ms (default: 200ms)
- Notification duration: 500-3000ms (default: 800ms)
Hotkeys are currently fixed to Ctrl+Alt+M and Ctrl+Alt+P.
# Build the project
dotnet build --configuration Release
# Publish as single-file executable
dotnet publish --configuration Release --runtime win-x64 --self-contained false -p:PublishSingleFile=trueThe executable will be in: bin\Release\net8.0-windows\win-x64\publish\ActiveWindowMuteToggle.exe
- .NET 8.0 Runtime (Windows)
- NAudio 2.2.1 (automatically installed via NuGet)
- Run
ActiveWindowMuteToggle.exe - The app runs in the system tray
- Use the hotkeys:
- Ctrl+Alt+M: Toggle mute for the active window's app
- Ctrl+Alt+P: Toggle priority mode for the active window's app
Right-click the tray icon to view hotkeys or exit the application.
- Press Ctrl+Alt+P while focused on your priority app (e.g., Discord)
- The app monitors audio output every 200ms
- When priority app plays audio (peak volume > 0.001):
- All other apps are ducked to 15% volume
- Original volumes are saved
- When priority app stops playing audio:
- All apps are restored to original volumes
- Press Ctrl+Alt+P again to disable priority mode
This project is provided as-is for personal use.