Situation:
I play music through my AirPlay speakers “Office” (2 HomePods). When I pause the audio and step away from the computer for a while, I come back to silence, ie no sound at all, regardless of volume level. However, if I switch to the built-in speakers and then back to AirPlay, everything works again.
This has been going on for several years, across different Macs and different versions of macOS. The Mac simply drops the AirPlay connection when I’m not around. Even if I leave audio playing, the connection eventually breaks (though I’m not sure exactly how long that takes, probably a few hours).
I have reported this to Apple multiple times with no result.
What I’ve tried:
Since switching to built-in audio and back fixes it, I thought a Keyboard Maestro script could automate that workaround. Unfortunately, KM’s “Set Audio Output Device” action doesn’t support AirPlay devices. I also looked into SwitchAudioSource (via Homebrew) and AppleScript, but neither offers a clean solution without additional installs or fragile UI automation.
Does anyone have a reliable workaround for keeping AirPlay connected, or a way to programmatically switch audio output to AirPlay on macOS?
I’m getting really tired of this… ![]()