Getting an AudioDeviceID from device unique identifier (UID)
Getting an AudioDeviceID from device unique identifier (UID)
- Subject: Getting an AudioDeviceID from device unique identifier (UID)
- From: "Sean McBride" <email@hidden>
- Date: Wed, 23 Apr 2003 10:29:44 -0400
- Organization: Matrox Electronic Systems Ltd.
Hi all,
I'm trying to get an AudioDeviceID from a known device unique identifier
(UID). kAudioHardwarePropertyDeviceForUID and
kAudioDevicePropertyDeviceUID look useful but the only info I found on
the net was qa1206, which does something similar to what I want by
iterating over all devices, but it seems there should be a more direct way.
I tried this:
AudioDeviceID myDevice;
AudioValueTranslation trans;
trans.mInputData = (void*)CFSTR ("AppleDBDMAAudioEngine:0");
trans.mInputDataSize = sizeof (CFStringRef);
trans.mOutputData = &myDevice;
trans.mOutputDataSize = sizeof (AudioDeviceID);
UInt32 size = sizeof (AudioValueTranslation);
OSStatus err = AudioHardwareGetProperty (
kAudioHardwarePropertyDeviceForUID,
&size,
&trans);
Which seems right based on the comments in AudioHardware.h. It returns
noErr, but myDevice is no good. I'm a CoreAudio newbie, so maybe the
error is obvious. :)
Thanks for any help,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Mac Software Designer +1-514-822-6000
Matrox Electronic Systems Ltd. Montrial, Quibec, Canada
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.