Simultaneous streaming to multiple AirPlay endpoints
Simultaneous streaming to multiple AirPlay endpoints
- Subject: Simultaneous streaming to multiple AirPlay endpoints
- From: Lorenzo Thurman <email@hidden>
- Date: Fri, 24 Oct 2014 10:59:11 -0500
Although I never needed to try it, at some point in the past, I believe this was possible (at least I’ve read posts about it. For example, http://bit.ly/1xhJ2vF). Somewhere in the last couple of revs of MacOS, this stopped working, it seems. So, is it possible to stream to multiple sources simultaneously, in a supported fashion? Here is some code I’ve tried. Sound only comes from the device listed first in the array:
OSStatus err = 0;
UInt32 size = sizeof(UInt32);
SSAudioSource * targetSource = airplayDevice.airplaySources;
AudioDeviceID airPlayDeviceID = targetSource.deviceID;
SSAudioSource * source1 = airplayDevice.airplaySources[0];
SSAudioSource * source2 = airplayDevice.airplaySources[1];
SSAudioSource * source3 = airplayDevice.airplaySources[2];
AudioDeviceID alldevices[] = {source3.sourceID, source2.sourceID, source1.sourceID}; // only source3 will play
AudioObjectPropertyAddress addr;
addr.mSelector = kAudioDevicePropertyDataSource;
addr.mScope = kAudioDevicePropertyScopeOutput;
addr.mElement = kAudioObjectPropertyElementMaster;
// Set the 'AirPlay' device to point to all of its sources...
err = AudioObjectSetPropertyData(airPlayDeviceID, &addr, 0, nil, size, alldevices);
AudioObjectPropertyAddress audioDevicesAddress = {
kAudioHardwarePropertyDefaultOutputDevice,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster
};
// ...now set the system output to point at the 'AirPlay' device
err = AudioObjectSetPropertyData(kAudioObjectSystemObject, &audioDevicesAddress, 0, nil, size, &airPlayDeviceID);
Any info greatly appreciated.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden