iOS Developer Library

Developer

AudioUnit Framework Reference Audio Component Services Reference

Options
Deployment Target:

On This Page
Language:

Audio Component Services Reference

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

  • Returns the generic name of an audio component.

    Declaration

    Swift

    func AudioComponentCopyName(_ inComponent: AudioComponent, _ outName: UnsafeMutablePointer<Unmanaged<CFString>?>) -> OSStatus

    Objective-C

    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.

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

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

    Declaration

    Swift

    func AudioComponentCount(_ inDesc: UnsafePointer<AudioComponentDescription>) -> UInt32

    Objective-C

    UInt32 AudioComponentCount ( const AudioComponentDescription *inDesc );

    Parameters

    inDesc

    The description of the audio components you want to count.

    Return Value

    The number of matching components on the system.

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

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

    Declaration

    Swift

    func AudioComponentFindNext(_ inAComponent: AudioComponent, _ inDesc: UnsafePointer<AudioComponentDescription>) -> AudioComponent

    Objective-C

    AudioComponent AudioComponentFindNext ( AudioComponent inComponent, const 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.

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

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

    Declaration

    Swift

    func AudioComponentGetDescription(_ inComponent: AudioComponent, _ outDesc: UnsafeMutablePointer<AudioComponentDescription>) -> OSStatus

    Objective-C

    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.

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

  • Determines if an audio component instance implements a particular function.

    Declaration

    Swift

    func AudioComponentInstanceCanDo(_ inInstance: AudioComponentInstance, _ inSelectorID: Int16) -> Boolean

    Objective-C

    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.

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 3.0 and later.

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

    Declaration

    Swift

    func AudioComponentGetVersion(_ inComponent: AudioComponent, _ outVersion: UnsafeMutablePointer<UInt32>) -> OSStatus

    Objective-C

    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

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

  • Disposes of an audio component instance.

    Declaration

    Swift

    func AudioComponentInstanceDispose(_ inInstance: AudioComponentInstance) -> OSStatus

    Objective-C

    OSStatus AudioComponentInstanceDispose ( AudioComponentInstance inInstance );

    Parameters

    inInstance

    The audio component instance that you want to dispose of.

    Return Value

    A result code.

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

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

    Declaration

    Swift

    func AudioComponentInstanceGetComponent(_ inInstance: AudioComponentInstance) -> AudioComponent

    Objective-C

    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.

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

  • Creates a new instance of an audio component.

    Declaration

    Swift

    func AudioComponentInstanceNew(_ inComponent: AudioComponent, _ outInstance: UnsafeMutablePointer<AudioComponentInstance>) -> OSStatus

    Objective-C

    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.

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

Data Types

  • An audio component.

    Declaration

    Swift

    typealias AudioComponent = COpaquePointer

    Objective-C

    typedef struct OpaqueAudioComponent *AudioComponent;

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

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

    Declaration

    Swift

    typealias AudioComponentInstance = COpaquePointer

    Objective-C

    typedef struct OpaqueAudioComponentInstance *AudioComponentInstance;

    Import Statement

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

  • Identifying information for an audio component.

    Declaration

    Swift

    struct AudioComponentDescription { var componentType: OSType var componentSubType: OSType var componentManufacturer: OSType var componentFlags: UInt32 var componentFlagsMask: UInt32 }

    Objective-C

    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 iOS 2.0 and later.