← Blog · March 8, 2026 · 6 min read
How SoundBrake Monitors Your Volume
SoundBrake is described as a system-tray utility that watches your volume. But "watching your volume" is a deceptively technical task — it means different things on Windows, macOS, and Linux, and doing it without administrator privileges or invasive system access adds constraints. This article explains the mechanics behind what SoundBrake actually does.
The Core Problem: Reading System Audio State
Every major operating system exposes audio state differently. There is no cross-platform API that returns "current output volume as a percentage" with a single call. SoundBrake therefore has a platform-specific audio reader for each OS, wrapped in a common interface that the rest of the application uses without needing to know the underlying implementation.
Windows: WASAPI via PowerShell COM Automation
On Windows, SoundBrake reads audio state through the Windows Audio Session API (WASAPI),
specifically the IMMDevice and IAudioEndpointVolume COM
interfaces exposed by Core Audio.
Rather than embedding a C++ or C# module to call these COM interfaces directly, SoundBrake uses a minimal inline PowerShell snippet that accesses the same interfaces via .NET's COM interop layer. This approach eliminates the need for additional native dependencies while still calling the authoritative Windows audio APIs.
The reader returns two values: the current master volume level (0.0–1.0) and a boolean indicating whether audio output is actively peaking — i.e., whether audio is actually being sent to the output device, not just whether audio is potentially playing. This distinction matters: if your volume is at 90% but nothing is playing, no exposure accumulates.
Linux: PulseAudio and PipeWire via pactl
On Linux, audio is managed by either PulseAudio or PipeWire (which emulates the
PulseAudio interface for compatibility). SoundBrake uses pactl — the
PulseAudio control tool — to query the current volume of the default audio sink.
pactl get-sink-volume @DEFAULT_SINK@ returns the volume as a percentage
string, which SoundBrake parses. To check whether audio is actively playing,
SoundBrake inspects the sink's state (pactl list sinks short). A sink
in RUNNING state has active audio output; IDLE or
SUSPENDED means no audio is playing.
macOS: osascript
On macOS, SoundBrake uses osascript — Apple's command-line interface to
the AppleScript/JavaScript for Automation (JXA) runtime — to query the system output
volume via the System Events application.
A one-line AppleScript call returns the current output volume (0–100) and mute state. SoundBrake handles the mute state explicitly: if the system is muted, no exposure is accumulated regardless of the underlying volume level.
The Polling Loop
SoundBrake checks audio state every 5 seconds. This interval was chosen as a balance between responsiveness and system resource use. At 5-second intervals, SoundBrake's background CPU usage is effectively negligible — far less than an idle browser tab.
On each poll, if audio is actively playing and the volume is above a threshold:
- The exposure counter for that threshold tier is incremented by one poll unit (5 seconds).
- If the counter reaches the threshold's warning limit, a notification is triggered.
- At the critical tier (≥95%), the system volume is automatically reduced to 70% and a more prominent notification is shown.
The Smart Backoff System
SoundBrake implements a dismissal backoff to prevent notification fatigue. If you dismiss a warning, the next warning for the same threshold is delayed progressively: the first dismissal adds a 30-minute delay, the second adds 60 minutes, and subsequent dismissals extend the delay up to a maximum of 2 hours.
This design means SoundBrake is assertive enough to create awareness but not so aggressive that users disable it entirely out of frustration. The "Silence for 24h" option available from the system tray icon provides an escape hatch for situations where you're explicitly choosing to listen at a higher level and don't want interruptions.
What SoundBrake Does Not Do
SoundBrake does not:
- Access or process any audio content — it reads only the volume level and peak state, not the audio stream itself.
- Make any network connections. There is no telemetry, no update check, no licensing verification.
- Store data outside your local machine. The only files written are a plain-text log and an optional silence timestamp, both ephemeral.
- Require administrator or root privileges for its core operation.
Binary Size and Footprint
SoundBrake is written in Go and compiles to a single native binary on each platform. The resulting executable is under 5 MB. At idle, memory usage is typically under 10 MB. There is no installer with bundled runtime dependencies — the binary is self-contained.
Next reading: Tinnitus Prevention: Stop the Ring Before It Starts →