feat: add per-app sound mixer with menu bar access#213
Open
lou1s19 wants to merge 1 commit into
Open
Conversation
Add an "App Sound" settings section and an optional menu bar item that opens a mixer styled after the system Sound panel: a system-volume slider, a per-app row for every app currently playing audio, and the current output device. Two control paths cover different apps: - Scriptable media apps (Music, Spotify, TV, iTunes) via AppleScript's `sound volume`. - Any other app that outputs audio, including browsers, via a Core Audio process tap (macOS 14.4+) that scales the app's samples through a private aggregate device. The menu bar item is opt-in and is created before the hide-menubar mark item so it survives collapsing. Adds NSAudioCaptureUsageDescription for the process-tap capture prompt.
lou1s19
requested review from
dadameng,
jacklandrin,
leonmtg and
shayanbo
as code owners
July 20, 2026 13:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a sound mixer to OnlySwitch — a new App Sound settings section and
an optional menu bar item that opens a compact mixer modeled on the macOS
system Sound panel:
volume slider
How it works
Two mechanisms, chosen automatically per app:
through AppleScript's standard
sound volume(0–100).a Core Audio process tap (
AudioHardwareCreateProcessTap, macOS 14.4+).macOS exposes no per-app output-level API, so the tap routes the app's audio
through a private aggregate device and scales the samples itself (continuous
gain, of which mute is the
0case). It falls back to silencing on anynon-Float32 stream format. Below macOS 14.4 only the scriptable apps appear.
Menu bar item
Opt-in via the App Sound settings toggle. It gets its own status item
(
speaker.wave.2.fill), created before the hide-menu-bar "mark" item so thatcollapsing the menu bar doesn't strip it. A hint in settings points to
System Settings › Control Center › Sound for anyone who wants it to stand in
for the system sound item.
Notes
NSAudioCaptureUsageDescription— the process tap triggers the systemaudio-capture permission prompt on first use.
Localizable.xcstringsin the full set oflanguages the project already ships.
toggle (add/remove), and the mixer popover. Feedback welcome on the
process-tap path across a wider range of apps.
Screenshots