• 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: Getting name of an Audio Unit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting name of an Audio Unit


  • Subject: Re: Getting name of an Audio Unit
  • From: Chris Adamson <email@hidden>
  • Date: Fri, 27 Aug 2010 12:48:06 -0400

That is surprising, but I now see the caveat in the docs for GetComponentInfo():

You may supply a component instance rather than a component identifier to this function, but you must coerce the data type appropriately

So it seems like the following should work

// get name from component
Handle unitNameHandle = NewHandle(256);
nameErr = GetComponentInfo((Component)unit, NULL,
 unitNameHandle, NULL, NULL);
NSString *unitName = @"Unknown";
if (nameErr == noErr) {
unitName = (NSString*) CFStringCreateWithPascalString (kCFAllocatorDefault,
(unsigned char *) *unitNameHandle,
kCFStringEncodingUTF8);
NSLog (@"got name %@", unitName);
} else {
NSLog (@"error getting unit name %d", nameErr);
}


(except that it doesn't… GetComponentInfo() returns -3000, badComponentId… maybe my code to look up the unit from the node is busted…)

Thanks for the reply.

--Chris


On Aug 27, 2010, at 10:53 AM, Doug Wyatt wrote:


On Aug 27, 2010, at 7:03 , Chris Adamson wrote:
Anyways, I don't see an equivalent to AudioComponentInstanceGetComponent()… is there a Component Manager function to get the component associated with a component instance?  If not, is there some other technique for getting the name of an given audio unit?


I remember being surprised to learn that with the Component Manager you can pass an instance to a function that expects a component.

hth
Doug


 _______________________________________________
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: Getting name of an Audio Unit
      • From: Chris Adamson <email@hidden>
References: 
 >Getting name of an Audio Unit (From: Chris Adamson <email@hidden>)
 >Re: Getting name of an Audio Unit (From: Doug Wyatt <email@hidden>)

  • Prev by Date: Re: kExtAudioFileProperty_CodecManufacturer and client formats
  • Next by Date: Re: Getting name of an Audio Unit
  • Previous by thread: Re: Getting name of an Audio Unit
  • Next by thread: Re: Getting name of an Audio Unit
  • Index(es):
    • Date
    • Thread