Audio Component Services Reference

Framework
AudioUnit/AudioUnit.h
Declared in
AudioComponent.h

Overview

Audio Component Services defines interfaces for finding and opening audio units and audio codecs. It preserves binary compatibility with OS X v10.5 component interfaces while removing dependency on the Component Manager.

Functions

AudioComponentCopyName

Returns the generic name of an audio component.

OSStatus AudioComponentCopyName (
   AudioComponent  inComponent,
   CFStringRef     *outName
);
Parameters
inComponent

The audio component that you want the generic name of.

outName

On output, the generic name of the specified audio component.

Return Value

A result code.

Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

AudioComponentCount

Returns the number of audio components that match a specified AudioComponentDescription structure.

UInt32 AudioComponentCount (
   AudioComponentDescription *inDesc
);
Parameters
inDesc

The description of the audio components you want to count.

Return Value

The number of matching components on the system.

Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

AudioComponentFindNext

Finds the next component that matches a specified AudioComponentDescription structure after a specified audio component.

AudioComponent AudioComponentFindNext (
   AudioComponent             inAComponent,
   AudioComponentDescription  *inDesc
);
Parameters
inAComponent

The audio component that you want to start searching after.

inDesc

The description of the audio component you want to find.

Return Value

An audio component.

Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

AudioComponentGetDescription

Gets the class description, as an AudioComponentDescription structure, of an audio component.

OSStatus AudioComponentGetDescription (
   AudioComponent             inComponent,
   AudioComponentDescription  *outDesc
);
Parameters
inComponent

The audio component that you want a description of.

outDesc

The description of the specified audio component.

Return Value

A result code.

Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

AudioComponentGetVersion

Gets the version of an audio component in hexadecimal form as 0xMMMMmmDD (major, minor, dot).

OSStatus AudioComponentGetVersion (
   AudioComponent  inComponent,
   UInt32          *outVersion
);
Parameters
inComponent

The audio component that you want the version of.

outVersion

The version of the specified audio component.

Return Value

A result code.

Discussion

Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

AudioComponentInstanceCanDo

Determines if an audio component instance implements a particular function.

Boolean AudioComponentInstanceCanDo (
   AudioComponentInstance  inInstance,
   SInt16                  inSelectorID
);
Parameters
inInstance

The audio component instance that you want to examine.

inSelectorID

An audio component function selector. The available values for audio units are listed in General Audio Unit Function Selectors and I/O Audio Unit Function Selectors.

Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

AudioComponentInstanceDispose

Disposes of an audio component instance.

OSStatus AudioComponentInstanceDispose (
   AudioComponentInstance inInstance
);
Parameters
inInstance

The audio component instance that you want to dispose of.

Return Value

A result code.

Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

AudioComponentInstanceGetComponent

Retrieves a reference to an audio component from an instance of that audio component.

AudioComponent AudioComponentInstanceGetComponent (
   AudioComponentInstance inInstance
);
Parameters
inInstance

The component instance whose corresponding factory object you want to get. Must not be NULL, and you must own the instance (specifically, you must not have previously called AudioComponentInstanceDispose on the instance).

Return Value

A reference to the desired audio component. If the value provided in the inInstance parameter is invalid, returns NULL.

Discussion

Use this function to retrieve a reference to the audio component that was used to instantiate a given audio component instance. You can then query the component for its attributes by calling the AudioComponentGetDescription function.

Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

AudioComponentInstanceNew

Creates a new instance of an audio component.

OSStatus AudioComponentInstanceNew (
   AudioComponent          inComponent,
   AudioComponentInstance  *outInstance
);
Parameters
inComponent

The audio component that you want to create a new instance of.

outInstance

On output, the new audio component instance.

Return Value

A result code.

Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

Data Types

AudioComponent

An audio component.

typedef struct OpaqueAudioComponent *AudioComponent;
Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

AudioComponentInstance

A component instance, or object, is an audio unit or audio codec.

typedef struct OpaqueAudioComponentInstance *AudioComponentInstance;
Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h

AudioComponentDescription

Identifying information for an audio component.

typedef struct AudioComponentDescription {
   OSType  componentType;
   OSType  componentSubType;
   OSType  componentManufacturer;
   UInt32  componentFlags;
   UInt32  componentFlagsMask;
} AudioComponentDescription;
Fields
componentType

A unique 4-byte code identifying the interface for the component.

componentSubType

A 4-byte code that you can use to indicate the purpose of a component. For example, you could use lpas or lowp as a mnemonic indication that an audio unit is a low-pass filter.

componentManufacturer

The unique vendor identifier, registered with Apple, for the audio component.

componentFlags

Set this value to zero.

componentFlagsMask

Set this value to zero.

Availability
  • Available in OS X v10.6 and later.
Declared In
AudioComponent.h