Menu

1 / 3

Which app made that beep? Tracing system sounds on macOS

DEV Community: swift·Zernonia·1 day ago
#pAhVH4El
#devtoswift#devto#dev#sound#process
Long article (1484 words) — no AI summary yet.
Reading 0:00
15s threshold

"Which app made that last beep?" came in as a feature request for Stat Space, and I assumed it would take an afternoon. The Volume tab already knew which apps were playing audio, so I'd just keep a short list of who started playing and when.

Then I triggered a beep and Core Audio told me, with complete confidence, that it came from systemsoundserverd . It always does. This post is the investigation that followed, what actually works, and what I left out.

The obvious approach, and why it's wrong

Core Audio exposes every audio client as a process object ( kAudioHardwarePropertyProcessObjectList ), each with a PID, a bundle id and whether it's outputting right now. No permission needed. Watch those for output starting and you have a "who played a sound" log.

I wrote a small spike, spike-sounds , that registers listeners on the process list and on each process object, then logs PID, bundle id, executable path and the frontmost app whenever output starts or stops.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.