so playing with Audio Hijack, it seems my "Airplay" audio output is *only* present in the interface if I'm currently choosing "Airplay" as my default audio output from the system
So basically with Audio Hijack I can do a "hack" which is:
- set my laptop to play on Airplay
- play some music there
- then if I want to listen to something else on my laptop, I have to create an Audio Hijack pipeline to play some other app on my laptop
Obviously I would prefer the reverse: by default play everything on the laptop, and be able to play a specific app on Airplay... but this doesn't seem to be possible because the "Airplay" device "disappears" from the interface as soon as I stop setting it as the default laptop output
One way to deal with a “transient” audio interface tripping various apps on macOS is by creating a virtual multi-output audio device in Audio MIDI Setup (stock app). That device will be persistent, even when one of its output devices is lost.
In my case the interface was AirPods. It was incredibly annoying when various audio software would reset its output device whenever they disconnect or auto-switch to the phone. So, I set up a multi-output device that outputs signal to the pods along with the wired headphone port, and configured audio software to output to that virtual device. After that, there is no flakiness: when the pods are connected then they get the audio, if they aren’t then they don’t get the audio, nothing else needs to be changed.
Interesting! Can you give more details on how to build this virtual audio device? I tried creating one but it doesn't show as output in the Airfoil app, is there something special to do?
Ensure that at least one of the checked output devices is available and normally it should appear among physical outputs in any software, including Airfoil (unless it’s hidden in Airfoil settings). If it doesn’t appear, then I don’t know what’s going on.
I’ve never used Airfoil though. To be honest, I feel like routing audio through a multi-output virtual audio device might defeat the point of the app if it’s meant to play to wireless devices directly.
> so playing with Audio Hijack, it seems my "Airplay" audio output is only present in the interface if I'm currently choosing "Airplay" as my default audio output from the system
Airfoil will maintain a connection with your Airplay device even after resetting your system audio device.
Though not perfect, but you can use applescript to force Airfoil's discovery of your airplay device by way of control center:
tell application "System Events" to tell process "Control Center"
repeat with menuBarItem in every menu bar item of menu bar 1
if description of menuBarItem as text is "Sound" then
set soundMenuBarItem to menuBarItem
exit repeat
end if
end repeat
click soundMenuBarItem
repeat with currentCheckbox in every checkbox of scroll area 1 of group 1 of window "Control Center"
set deviceId to value of attribute "AXIdentifier" of currentCheckbox
set deviceName to text 14 thru -1 of deviceId
if deviceName as string is equal to "DEVICE NAME" then -- DEVICE_NAME is the name of your airplay audio device in control center.
click currentCheckbox
click soundMenuBarItem
exit repeat
end if
end repeat
end tell
Airfoil supports scripting[0] so you can connect an application to the airplay speaker using this AppleScript:
tell application "Airfoil"
set safariSource to make new application source
set application file of safariSource to "/Applications/Safari.app"
set current audio source to safariSource
set aSpeaker to (first speaker whose name is "INSTANCE_NAME") -- Paste the Airplay speaker's instance name here
if not (connected of aSpeaker) then
connect to aSpeaker
else
disconnect from aSpeaker
end if
end tell
You can run this command in the command line to get the instance name of your airplay device:
dns-sd -B _airplay._tcp
You can make some combination of this to form a workflow that suits you.
- redirect my music (eg Youtube music) to my Apple Homepod
- still play all other audio (eg some podcast or video) on my laptop
but it doesn't work / is buggy / either puts everything in one location or the other
Has anyone here found a good setup to redirect the audio from exactly one app to the Homepod, and keep all the rest on the laptop audio?