• 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
Inconsistencies in getting kAudioObjectPropertyName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inconsistencies in getting kAudioObjectPropertyName


  • Subject: Inconsistencies in getting kAudioObjectPropertyName
  • From: Brian Willoughby <email@hidden>
  • Date: Mon, 16 Jun 2008 00:58:45 -0700

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

  • Follow-Ups:
    • Re: Inconsistencies in getting kAudioObjectPropertyName
      • From: Jeff Moore <email@hidden>
    • Re: Inconsistencies in getting kAudioObjectPropertyName
      • From: "Mikael Hakman" <email@hidden>
  • Prev by Date: Re: Getting Started
  • Next by Date: Re: Inconsistencies in getting kAudioObjectPropertyName
  • Previous by thread: Re: ExtAudioFileSetProperty
  • Next by thread: Re: Inconsistencies in getting kAudioObjectPropertyName
  • Index(es):
    • Date
    • Thread