• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Inconsistencies in getting kAudioObjectPropertyName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inconsistencies in getting kAudioObjectPropertyName


  • Subject: Re: Inconsistencies in getting kAudioObjectPropertyName
  • From: "Mikael Hakman" <email@hidden>
  • Date: Mon, 16 Jun 2008 11:54:54 +0200
  • Organization: Datakonsulten AB

This is my experience using 10.5 too. In early 10.5 I couldn't use AudioDeviceGetProperty for getting device name either. AudioObjectGetPropertyData works ok which is the reason I never use AudioDeviceGetProperty anymore.

/Mikael

On Monday, June 16, 2008 9:58 AM, Brian Willoughby wrote:


Hello,

I'm working with audio devices that have multiple streams, and I've
noticed an inconsistency when I try to get the device name and stream
names as displayed in Audio MIDI Setup.

For the first example, if I want to get the name of the overall audio
device, I would use the following code:

stat = AudioDeviceGetPropertyInfo(deviceID, 0, 1,
kAudioObjectPropertyName, &size, NULL);
if (!stat)
{
stat = AudioDeviceGetProperty(deviceID, 0, 1,
kAudioObjectPropertyName, &size, &srDeviceName);
if (!stat)
CFStringGetCStringPtr(srDeviceName, kCFStringEncodingMacRoman);
}

However, the above code is completely ineffective when trying to get
the name of a stream.  In the second example, to get the name of a
stream, I found that I must use the following code:

aopa.mSelector = kAudioObjectPropertyName;
aopa.mScope = kAudioObjectPropertyScopeGlobal;
aopa.mElement = kAudioObjectPropertyElementMaster;
stat = AudioObjectGetPropertyDataSize(streamID, &aopa, 0, NULL, &size);
if (!stat)
{
stat = AudioObjectGetPropertyData(streamID, &aopa, size, NULL,
&size, &srStreamName);
if (!stat)
CFStringGetCStringPtr(srStreamName, kCFStringEncodingMacRoman);
}

Is there any reason why AudioDeviceGetProperty is sufficient for
getting the device name but not the stream name?  I tried various
different values for inChannel, assuming that would be how to select
the stream within a device, and I also tried supplying the streamID
instead of the deviceID, but nothing worked.  Is there any reason why
AudioObjectGetPropertyData is required to get the stream name?  It
seems like the shortcut API for one name should work for the other as
well.

I'm working with CoreAudio 1.4.3 on Tiger 10.4.11 (since Leopard is
still not stable).  I thought of trying this again on Leopard, but I
did not save examples of every code variation that I tried.  I'm
hoping it's something simple...

Brian Willoughby
Sound Consulting

_______________________________________________ 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
References: 
 >Inconsistencies in getting kAudioObjectPropertyName (From: Brian Willoughby <email@hidden>)

  • Prev by Date: Inconsistencies in getting kAudioObjectPropertyName
  • Next by Date: Re: Hexaphonic AudioUnits in AUGraph that mixes to stereo
  • Previous by thread: Inconsistencies in getting kAudioObjectPropertyName
  • Next by thread: Re: Inconsistencies in getting kAudioObjectPropertyName
  • Index(es):
    • Date
    • Thread