A Windows desktop application that intelligently lowers music volume when study applications become active.
StudyMute is a Windows desktop application that monitors real-time audio activity from selected study applications (e.g., Zoom, Teams, Chrome) and automatically reduces the volume of configured music applications (e.g., Spotify).
When study audio stops, the original music volume is restored smoothly.
The application integrates directly with the Windows Core Audio API via managed interop for low-latency, system-level audio control.
- 🎧 Real-time Windows audio session monitoring
- 🔉 Automatic music volume fading during study activity
- 🎚 Configurable fade duration and target volume
- 🔄 Smooth volume restoration
- ♻ Self-healing audio session reattachment
- 🧠 Idempotent Start/Stop lifecycle handling
- 🧵 Thread-safe background monitoring
- 🧹 Clean uninstall support
Recent architectural hardening ensures:
- Safe rapid Start → Stop → Start transitions
- No duplicate CoreAudio callback registrations
- Proper COM object lifecycle management
- No monitoring loop ghost tasks
- Memory-stable long-running operation
- Correct device-switch handling (while running or stopped)
- Clean session cache reset on restart
The monitoring pipeline is fully symmetric:
- Stop cascades downward
- Start rebuilds upward
Each layer (UI → Coordinator → Monitor → CoreAudio) enforces idempotent lifecycle behavior.
The solution follows a layered architecture:
StudyMute/
├── src/
│ ├── StudyMute.Core/ # Domain logic & interfaces
│ ├── StudyMute.Infrastructure/ # Windows CoreAudio integration & services
│ └── StudyMute.UI/ # WPF MVVM application
- Domain models
- Application contracts
- Interface abstractions
- NAudio CoreAudio integration
- Audio session monitoring
- Activity detection engine
- Volume control services
- Thread-safe coordination logic
- WPF (.NET 8 Windows Desktop)
- MVVM pattern
- Lifecycle-controlled background orchestration
- Language: C# 12
- Framework: .NET 8 (Windows Desktop)
- UI: WPF (MVVM)
- Audio Interop: NAudio.CoreAudioApi
- Logging: Serilog
- Concurrency: Task, CancellationTokenSource, ConcurrentDictionary
- Installer: Inno Setup
- Testing: xUnit + Moq
- Windows 10 / 11 (64-bit)
- x64 architecture
- Active audio output device
-
Download the latest installer:
StudyMute_vX.X.X_Setup.exe -
Run the installer:
Next → Install → Finish
The installer will:
- Install StudyMute into Program Files
- Create Start Menu entry
- Optionally create Desktop shortcut
- Register clean uninstall support
git clone https://github.com/NJ555/StudyMute.git
cd StudyMute
dotnet publish src/StudyMute.UI/StudyMute.UI.csproj -c Release -r win-x64 --self-contained true
Executable output:
src/StudyMute.UI/bin/Release/net8.0-windows/win-x64/publish/StudyMute.UI.exe
- Launch StudyMute
- Add study applications (e.g., zoom, teams, chrome)
- Add music applications (e.g., spotify)
- Set fade duration and target volume
- Click Start Monitoring
When study audio is detected:
→ Music volume fades down
When study audio stops:
→ Music volume restores automatically
Lifecycle reliability is verified via automated tests:
- Double Start protection
- Double Stop protection
- Repeated Start/Stop transitions
- Coordinator idempotency validation
Run tests:
dotnet test
Each GitHub release includes:
- Windows installer (.exe)
- Versioned release notes
- Production-ready self-contained build
- Clean uninstall support
MIT License