How to use AudioHardwareGetProperty
How to use AudioHardwareGetProperty
- Subject: How to use AudioHardwareGetProperty
- From: Malcolm Haylock <email@hidden>
- Date: Thu, 7 Aug 2003 10:13:53 +0100
Hi everyone,
I'm not quite sure how to use AudioHardwareGetProperty to retrieve
the AudioDeviceID for a particular unique ID, but this question
applies to retrieving any value which requires input.
extern OSStatus AudioHardwareGetProperty(
AudioHardwarePropertyID inPropertyID,
UInt32* ioPropertyDataSize,
void* outPropertyData);
As I understand it (by guessing from the "documentation"), both the
input and output are passed by the same pointer outPropertyData.
Therefore to pass the UID and return the AudioDeviceID would be
something like:
CFStringRef uid; // set somewhere else
Ptr outPropertyData=uid;
UInt32 ioPropertyDataSize=sizeof(uid);
OSStatus err=AudioHardwareGetProperty(
kAudioHardwarePropertyDeviceForUID,
&ioPropertyDataSize,
outPropertyData);
AudioDeviceID id=*((AudioDeviceID*) outPropertyData);
I'm probably way off the mark here but please correct me.
From AudioHardware.h
kAudioHardwarePropertyDeviceForUID = 'duid',
// retrieves the AudioDeviceID for the given device
// unique identifier previously retrieved with
// kAudioDevicePropertyUID (see below) using an
// AudioValueTranslation structure. The input is a
// CFStringRef containing the UID and the output
// is an AudioDeviceID.
Thanks,
Malcolm Haylock
_______________________________________________
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.