I just want to throw my hat in here and say I'm also interested in trying to figure this out. I sent a message out to this mailing list awhile back asking a similar question; I'll reproduce the message I sent to the list at the end of this note.
This was a touted capability of AirPlay 2 on macOS, which I believe Apple said at one point was gonna involve creating a Mac counterpart to iOS's AVRoutePickerView. Since I asked about this in late December *2017*, AirPlay 2 has come to iTunes, but still not macOS as a whole, I guess. (?) In my old note, I talk about what appears to be the old way of exposing AirPlay devices by asking for a list of TransportManagers in a particular way. As a starting point here, it might be worth trying to expose the list in the same way. Maybe now that AirPlay 2 exists within iTunes, the API will behave differently? I cannot test it myself as I'm running an outdated system. Let's make AirPlay relevant for macOS developers again! Please! old note: Hello folks, I've been trying to work out a way to route my program's audio output to a specific AirPlay device; ideally, as a system output device, and *without *needing to have already selected the device through System Preferences or the AirPlay menu bar item. There exists an ancient blog post describing how this process used to work in Mountain Lion, https://joris.kluivers.nl/blog/2012/07/25/per-application-airplay-in-mountain-lion/ , but AirPlay devices are no longer exposed as system output devices in the same way (since Yosemite or El Capitan). While looking for leads, I found this tidbit in the header for AudioTransportManager inside AudioHardwareBase.h, which describes a process for making AirPlay devices into AudioEndPoints that programs can output sound to: https://github.com/phracker/MacOSX-SDKs/blob/master/MacOSX10.9.sdk/System/Library/Frameworks/ CoreAudio.framework/Versions/A/Headers/AudioHardwareBase.h#L388 However, asking for the list of TransportManagers the way the header prescribes turns up an empty list (Swift playground code): https://gist.github.com/jcm93/98be5d2878d1e4a62c6b2dc9c14e0bcb I filed a DTS incident to ask about this, and heard back that "there is no supported way to achieve the desired functionality given the currently shipping system configurations." I've already filed an enhancement request. So, in the meantime... can anyone think of an unsupported way? On Fri, Jan 4, 2019 at 12:45 AM Hendrik Schreiber <[email protected]> wrote: > Happy New Year, everybody. > > Just wanted to re-send this, as it probably got buried in all those > holiday and new years emails. > > Can anybody help me with this or is the API insufficient and it’s simply > not possible? > > Thank you! > > -hendrik > > > On Dec 24, 2018, at 13:35, Hendrik Schreiber <[email protected]> wrote: > > > > Hey there, > > > > I’d like to programmatically play back audio on airplay devices, > preferably via AVPlayer on macOS. > > > > Can anybody recommend the best and simplest way to achieve this? > > > > I.e.: > > > > 1. Discover AirPlay devices > > 2. Select one or more of these devices for output > > 3. Play back audio (synchronized) on these devices > > > > The synchronized part would be nice, but is not essential. > > > > How would I do this? > > > > Some of this used to be possible via deviceIds (see > https://stackoverflow.com/q/53806020/942774), but apparently isn’t > anymore. > > > > Thanks & happy holidays! > > > > -hendrik > > > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Coreaudio-api mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/coreaudio-api/jcmoods%40gmail.com > > This email sent to [email protected] >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com This email sent to [email protected]
