If you’ve ever tried to capture system audio in an Electron app on macOS, you know how frustrating it can be. The typical approach looks something like this:
Some clever developers have sidestepped this mess by writing native Swift apps that capture system audio, then stream it to their Electron app or save it to disk.
If you’re going down this route in 2025, I highly recommend checking out Nick Payne’s excellent audiotee. If it had existed seven years ago, I might’ve cried tears of joy. It’s that good — clean API, easy setup, just works.
I wanted something cleaner. No drivers. No native apps. Just Electron, shipping with zero extra binaries, working out of the box.
Turns out, the Chromium team has already built robust system audio loopback support into the browser across platforms. They’ve done amazing work. The only catch? A lingering macOS screen capture bug has kept this feature out of reach for Electron apps — if you’re capturing video.
On macOS 13+, enable both MacLoopbackAudioForScreenShare and MacSckSystemAudioLoopbackOverride. Then, in your setDisplayMediaRequestHandler callback, pass "loopback" as the audio param.