Getting the Source Names
Getting the Source Names
- Subject: Getting the Source Names
- From: Robert Penland <email@hidden>
- Date: Thu, 10 Apr 2003 11:12:28 -0700
Can anybody tell me what the proper parameter list is for getting the data
source names using kAudioDevicePropertyDataSourceNameForIDCFString in a
AudioDeviceGetProperty call? What little documentation that I have found
says that the input parameter should be the source ID (which you get with
another call) and the output parameter should be a CFStringRef. The code I
am using is as follows:
CFMutableStringRef theEntryName;
theEntryName = CFStringCreateMutable(NULL,
255);
UInt32 numEntries;
// this finds out the size of the DataSource
ID array
err =
AudioDeviceGetPropertyInfo(theBuiltInID,0,true,kAudioDevicePropertyDataSourc
es,&thePropSize,&isWritable);
numEntries = thePropSize/sizeof(UInt32);
UInt32 *theEntries;
theEntries = (UInt32 *) malloc(thePropSize);
// this gets the array of DataSource ID's
err =
AudioDeviceGetProperty(theBuiltInID,0,true,kAudioDevicePropertyDataSources,&
thePropSize,theEntries);
for(j=0;j < numEntries;j++)
{
err =
AudioDeviceGetProperty(theBuiltInID,0,true,kAudioDevicePropertyDataSourceNam
eForIDCFString,theEntries[j],theEntryName);
}
Everything works and returns values that I would expect up until the
kAudioDevicePropertyDataSourceNameForIDCFString call, where I get a
EXC_BAD_ACCESS error.
I've tried passing pointer to parameters as well, with the same results.
Any ideas.
Thanks,
Rob
_______________________________________________
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.