Re: Enumerating Airplay devices
Re: Enumerating Airplay devices
- Subject: Re: Enumerating Airplay devices
- From: Lorenzo Thurman <email@hidden>
- Date: Wed, 09 Apr 2014 19:23:21 -0500
Outstanding! Thanks guys, I really appreciate this.
I have this working in my app.
First get the available data sources for the audio device:
int getDataSourceIDs(bool input, Array <OSType>& dataSourceIDs) { if (deviceID != 0) { AudioObjectPropertyAddress pa; pa.mSelector = kAudioDevicePropertyDataSources; pa.mScope = ((input == true) ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput); pa.mElement = kAudioObjectPropertyElementMaster; UInt32 size = 0; if ( OK(AudioObjectGetPropertyDataSize (deviceID, &pa, 0, 0, &size))) { HeapBlock<OSType> sources; sources.calloc (size, 1); if ( OK(AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, sources))) { int num = size / (int) sizeof (OSType); for(int i=0; i < num; i++) dataSourceIDs.add(sources[i]); return num; } } } return 0; }
|
_______________________________________________
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