iOS Developer Library

Developer

AudioUnit Framework Reference Audio Unit Properties Reference

Options
Deployment Target:

On This Page
Language:

Audio Unit Properties Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import AudioUnit

Objective-C

@import AudioUnit;

Audio unit properties, part of the audio unit plug-in interface, are key-value pairs that declare attributes or behavior such as audio data stream format, latency, or connection from one audio unit to another. Properties are typically non-time-varying, not directly settable by the user, and changeable only before an audio unit is initialized. This document describes audio unit property identifiers and their accompanying values.

You access audio unit properties using the Audio Unit framework’s “Get” and “Set” functions, described in Audio Unit Component Services Reference. These functions are:

So-called generic audio unit properties are those that can apply to any audio unit. There are also Apple-specific properties that apply only to Apple-supplied audio units. This document describes both. Apple reserves property IDs from 0 through 63999; you may use property IDs above this range.

In addition to its value, the attributes of an audio unit property are as follows:

  • Scope—the programmatic context, within an audio unit, that the property applies to. A property applies to one or more scopes, as described in this document. The audio unit scopes in iOS are Input, Output, and Global. In OS X, audio units have additional, MIDI-related scopes: Group, Part, and Note.

  • Data type—the programmatic data type for the property’s value.

  • Access—read-only, write-only, or read/write.

Functions

  • Gets the display type for a parameter.

    Declaration

    Objective-C

    #define GetAudioUnitParameterDisplayType (flags) ( (flags) & kAudioUnitParameterFlag_DisplayMask )

    Parameters

    flags

    Import Statement

    Objective-C

    @import AudioUnit;

    Availability

    Available in iOS 2.0 and later.

  • Determines if the display type is logarithmic.

    Declaration

    Objective-C

    #define AudioUnitDisplayTypeIsLogarithmic (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplayLogarithmic )

    Parameters

    flags

    Import Statement

    Objective-C

    @import AudioUnit;

    Availability

    Available in iOS 2.0 and later.

  • Determines if the display type is square root.

    Declaration

    Objective-C

    #define AudioUnitDisplayTypeIsSquareRoot (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplaySquareRoot )

    Parameters

    flags

    Import Statement

    Objective-C

    @import AudioUnit;

    Availability

    Available in iOS 2.0 and later.

  • Determines if the display type is squared.

    Declaration

    Objective-C

    #define AudioUnitDisplayTypeIsSquared (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplaySquared )

    Parameters

    flags

    Import Statement

    Objective-C

    @import AudioUnit;

    Availability

    Available in iOS 2.0 and later.

  • Determines if the display type is cubed.

    Declaration

    Objective-C

    #define AudioUnitDisplayTypeIsCubed (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplayCubed )

    Parameters

    flags

    Import Statement

    Objective-C

    @import AudioUnit;

    Availability

    Available in iOS 2.0 and later.

  • Determines if the display type is cube root.

    Declaration

    Objective-C

    #define AudioUnitDisplayTypeIsCubeRoot (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplayCubeRoot )

    Parameters

    flags

    Import Statement

    Objective-C

    @import AudioUnit;

    Availability

    Available in iOS 2.0 and later.

  • Determines if the display type is exponential.

    Declaration

    Objective-C

    #define AudioUnitDisplayTypeIsExponential (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplayExponential )

    Parameters

    flags

    Import Statement

    Objective-C

    @import AudioUnit;

    Availability

    Available in iOS 2.0 and later.

  • Sets the display type.

    Declaration

    Objective-C

    #define SetAudioUnitParameterDisplayType (flags, displayType) ( ((flags) & ~kAudioUnitParameterFlag_DisplayMask) | (displayType) )

    Parameters

    flags

    displayType

    Import Statement

    Objective-C

    @import AudioUnit;

    Availability

    Available in iOS 2.0 and later.

Callbacks

Audio unit host applications can implement these callback functions to provide information to audio units.

  • When called by the system, provides beat and tempo information to an audio unit from a host application.

    Declaration

    Swift

    typealias HostCallback_GetBeatAndTempo = CFunctionPointer<((UnsafeMutablePointer<Void>, UnsafeMutablePointer<Float64>, UnsafeMutablePointer<Float64>) -> OSStatus)>

    Objective-C

    typedef OSStatus (*HostCallback_GetBeatAndTempo) ( void *inHostUserData, Float64 *outCurrentBeat, Float64 *outCurrentTempo );

    Parameters

    inHostUserData

    Custom data that you provided when registering your callback with the audio unit.

    outCurrentBeat

    On output, the current beat of the music that is playing.

    outCurrentTempo

    On output, the current tempo of the music that is playing.

    Import Statement

    Objective-C

    @import AudioUnit;

    Swift

    import AudioUnit

    Availability

    Available in iOS 5.0 and later.

  • When called by the system, provides musical timing information to an audio unit from a host application.

    Declaration

    Swift

    typealias HostCallback_GetMusicalTimeLocation = CFunctionPointer<((UnsafeMutablePointer<Void>, UnsafeMutablePointer<UInt32>, UnsafeMutablePointer<Float32>, UnsafeMutablePointer<UInt32>, UnsafeMutablePointer<Float64>) -> OSStatus)>

    Objective-C

    typedef OSStatus (*HostCallback_GetMusicalTimeLocation) ( void *inHostUserData, UInt32 *outDeltaSampleOffsetToNextBeat, Float32 *outTimeSig_Numerator, UInt32 *outTimeSig_Denominator, Float64 *outCurrentMeasureDownBeat );

    Parameters

    inHostUserData

    Custom data that you provided when registering your callback with the audio unit.

    outDeltaSampleOffsetToNextBeat

    On output, the number of samples until the next beat.

    outTimeSig_Numerator

    On output, the numerator for a musical time signature.

    outTimeSig_Denominator

    On output, the denominator for a musical time signature.

    outCurrentMeasureDownBeat

    Import Statement

    Objective-C

    @import AudioUnit;

    Swift

    import AudioUnit

    Availability

    Available in iOS 5.0 and later.

  • When called by the system, provides audio transport state and timeline information to an audio unit from a host application.

    Declaration

    Swift

    typealias HostCallback_GetTransportState = CFunctionPointer<((UnsafeMutablePointer<Void>, UnsafeMutablePointer<Boolean>, UnsafeMutablePointer<Boolean>, UnsafeMutablePointer<Float64>, UnsafeMutablePointer<Boolean>, UnsafeMutablePointer<Float64>, UnsafeMutablePointer<Float64>) -> OSStatus)>

    Objective-C

    typedef OSStatus (*HostCallback_GetTransportState) ( void *inHostUserData, Boolean *outIsPlaying, Boolean *outTransportStateChanged, Float64 *outCurrentSampleInTimeLine, Boolean *outIsCycling, Float64 *outCycleStartBeat, Float64 *outCycleEndBeat );

    Parameters

    inHostUserData

    Custom data that you provided when registering your callback with the audio unit.

    outIsPlaying

    On output, TRUE if audio is playing, or FALSE otherwise.

    outTransportStateChanged

    On output, TRUE if the transport state changed since the last time the callback was invoked, or FALSE otherwise.

    outCurrentSampleInTimeLine

    On output, the sample number, indexed from zero from the beginning of the timeline.

    outIsCycling

    On output, TRUE if cycling, or FALSE otherwise.

    outCycleStartBeat

    outCycleEndBeat

    Import Statement

    Objective-C

    @import AudioUnit;

    Swift

    import AudioUnit

    Availability

    Available in iOS 5.0 and later.

On the desktop, MIDI audio units can implement these callbacks to provide MIDI data to audio unit host applications.

Data Types

  • The audio input and output channel capabilities for an audio unit.

    Declaration

    Swift

    struct AUChannelInfo { var inChannels: Int16 var outChannels: Int16 init() init(inChannels inChannels: Int16, outChannels outChannels: Int16) }

    Objective-C

    typedef struct AUChannelInfo { SInt16 inChannels; SInt16 outChannels; } AUChannelInfo;

    Fields

    inChannels

    The number of input channels.

    outChannels

    The number of output channels.

    Discussion

    Availability

    Available in iOS 2.0 and later.

  • An audio unit parameter whose value can change in response to a change in its parent metaparameter.

    Declaration

    Swift

    struct AUDependentParameter { var mScope: AudioUnitScope var mParameterID: AudioUnitParameterID init() init(mScope mScope: AudioUnitScope, mParameterID mParameterID: AudioUnitParameterID) }

    Objective-C

    typedef struct AUDependentParameter { AudioUnitScope mScope; AudioUnitParameterID mParameterID; } AUDependentParameter;

    Fields

    mScope

    mParameterID

    Availability

    Available in iOS 6.0 and later.

  • A timestamp for scheduled starting of an I/O audio unit.

    Declaration

    Swift

    struct AudioOutputUnitStartAtTimeParams { var mTimestamp: AudioTimeStamp var mFlags: UInt32 init() init(mTimestamp mTimestamp: AudioTimeStamp, mFlags mFlags: UInt32) }

    Objective-C

    typedef struct AudioOutputUnitStartAtTimeParams { AudioTimeStamp mTimestamp; UInt32 mFlags; } AudioOutputUnitStartAtTimeParams;

    Fields

    mTimestamp

    mFlags

    Availability

    Available in iOS 2.0 and later.

  • An audio unit source-to-destination connection specification.

    Declaration

    Swift

    struct AudioUnitConnection { var sourceAudioUnit: AudioUnit var sourceOutputNumber: UInt32 var destInputNumber: UInt32 init() init(sourceAudioUnit sourceAudioUnit: AudioUnit, sourceOutputNumber sourceOutputNumber: UInt32, destInputNumber destInputNumber: UInt32) }

    Objective-C

    typedef struct AudioUnitConnection { AudioUnit sourceAudioUnit; UInt32 sourceOutputNumber; UInt32 destInputNumber; } AudioUnitConnection;

    Fields

    sourceAudioUnit

    The audio unit that is serves as the source in the connection.

    sourceOutputNumber

    The source audio unit’s output element to be used in the connection.

    destInputNumber

    The destination audio unit’s input element to be used in the connection.

    Availability

    Available in iOS 2.0 and later.

  • Allows an audio unit host application to tell an audio unit to use a specified buffer for its input callback.

    Declaration

    Swift

    struct AudioUnitExternalBuffer { var buffer: UnsafeMutablePointer<UInt8> var size: UInt32 init() init(buffer buffer: UnsafeMutablePointer<UInt8>, size size: UInt32) }

    Objective-C

    typedef struct AudioUnitExternalBuffer { Byte *buffer; UInt32 size; } AudioUnitExternalBuffer;

    Fields

    buffer

    size

    Availability

    Available in iOS 2.0 and later.

  • An audio unit’s audio level at a particular frequency.

    Declaration

    Swift

    struct AudioUnitFrequencyResponseBin { var mFrequency: Float64 var mMagnitude: Float64 init() init(mFrequency mFrequency: Float64, mMagnitude mMagnitude: Float64) }

    Objective-C

    typedef struct AudioUnitFrequencyResponseBin { Float64 mFrequency; Float64 mMagnitude; } AudioUnitFrequencyResponseBin;

    Fields

    mFrequency

    mMagnitude

    Discussion

    An array of AudioUnitFrequencyResponseBin are passed in to kAudioUnitProperty_FrequencyResponse with the mFrequency field filled in. The array is returned with the mMagnitude fields filled in. If fewer than kNumberOfResponseFrequencies are needed, then the first unused bin should be marked with a negative frequency.

    Availability

    Available in iOS 2.1 and later.

  • Audio clipping that has occurred in a mixer unit.

    Declaration

    Swift

    struct AudioUnitMeterClipping { var peakValueSinceLastCall: Float32 var sawInfinity: Boolean var sawNotANumber: Boolean init() init(peakValueSinceLastCall peakValueSinceLastCall: Float32, sawInfinity sawInfinity: Boolean, sawNotANumber sawNotANumber: Boolean) }

    Objective-C

    typedef struct AudioUnitMeterClipping { Float32 peakValueSinceLastCall; Boolean sawInfinity; Boolean sawNotANumber; } AudioUnitMeterClipping;

    Fields

    peakValueSinceLastCall

    The maximum value seen on the channel since the last time the property was retrieved.

    sawInfinity

    TRUE if there was an infinite value on this channel since the last time the property was retrieved.

    sawNotANumber

    TRUE if there was a floating point “not a number” value on this channel since the last time the property was retrieved.

    Discussion

    This data structure is used by the kAudioUnitProperty_MeterClipping property.

    Availability

    Available in iOS 2.0 and later.

  • The unit-of-measure for an audio unit parameter.

    Declaration

    Swift

    typealias AudioUnitParameterUnit = UInt32

    Objective-C

    typedef UInt32 AudioUnitParameterUnit;

    Discussion

    The various units of measure for audio unit parameters are described in Audio Unit Parameter Units of Measure.

    Import Statement

    Objective-C

    @import AudioUnit;

    Swift

    import AudioUnit

    Availability

    Available in iOS 2.0 and later.

  • Declaration

    Swift

    struct AudioUnitParameterInfo { var name: (Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8) var unitName: Unmanaged<CFString>! var clumpID: UInt32 var cfNameString: Unmanaged<CFString>! var unit: AudioUnitParameterUnit var minValue: AudioUnitParameterValue var maxValue: AudioUnitParameterValue var defaultValue: AudioUnitParameterValue var flags: UInt32 init() init(name name: (Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8), unitName unitName: Unmanaged<CFString>!, clumpID clumpID: UInt32, cfNameString cfNameString: Unmanaged<CFString>!, unit unit: AudioUnitParameterUnit, minValue minValue: AudioUnitParameterValue, maxValue maxValue: AudioUnitParameterValue, defaultValue defaultValue: AudioUnitParameterValue, flags flags: UInt32) }

    Objective-C

    typedef struct AudioUnitParameterInfo { char name[52]; CFStringRef unitName; UInt32 clumpID; CFStringRef cfNameString; AudioUnitParameterUnit unit; AudioUnitParameterValue minValue; AudioUnitParameterValue maxValue; AudioUnitParameterValue defaultValue; UInt32 flags; } AudioUnitParameterInfo;

    Fields

    name

    Must be set to 0.

    unitName

    If kAudioUnitParameterUnit_CustomUnit is set, this field must contain a valid CFString object. Only valid if kAudioUnitParameterUnit_CustomUnit is set.

    clumpID

    Only valid if kAudioUnitParameterFlag_HasClump is set.

    cfNameString

    Only valid if kAudioUnitParameterFlag_HasCFNameString is set.

    unit

    If the unit field contains a value not in the AudioUnitParameterUnit enumeration, then assume the unit type is kAudioUnitParameterUnit_Generic.

    minValue

    maxValue

    defaultValue

    flags

    Due to some vagaries about the ways in which Parameter's CFNames have been described, it was necessary to add a flag: kAudioUnitParameterFlag_CFNameRelease. In normal usage a parameter name is essentially a static object, but sometimes an audio unit will generate parameter names dynamically. As these are expected to be CFString objects, in that case the host should release those names when it is finished with them, but there was no way to communicate this distinction in behavior. Thus, if an audio unit can generate a name dynamically, it should set this flag in the parameter's info. The host should check for this flag and, if present, release the parameter name when it is finished with it.

    Availability

    Available in iOS 2.0 and later.

  • A short version of the name for an audio unit parameter.

    Declaration

    Swift

    struct AudioUnitParameterNameInfo { var inID: AudioUnitParameterID var inDesiredLength: Int32 var outName: Unmanaged<CFString>! init() init(inID inID: AudioUnitParameterID, inDesiredLength inDesiredLength: Int32, outName outName: Unmanaged<CFString>!) }

    Objective-C

    typedef struct AudioUnitParameterNameInfo { AudioUnitParameterID inID; SInt32 inDesiredLength; CFStringRef outName; } AudioUnitParameterIDName;

    Fields

    inID

    The identifier for the audio unit parameter.

    inDesiredLength

    When setting an audio unit property that uses this data structure for its value, the maximum length that you are specifying for the audio unit parameter name.

    outName

    When getting an audio unit property that uses this data structure for its value, the short version of the parameter name provided by the audio unit. The host application then owns the string and is responsible for releasing it.

    Discussion

    This data structure is used as a value for the kAudioUnitProperty_ParameterClumpName and kAudioUnitProperty_ParameterIDName audio unit properties.

    Availability

    Available in iOS 8.0 and later.

  • A string representation of a parameter’s value.

    Declaration

    Swift

    struct AudioUnitParameterStringFromValue { var inParamID: AudioUnitParameterID var inValue: UnsafePointer<AudioUnitParameterValue> var outString: Unmanaged<CFString>! init() init(inParamID inParamID: AudioUnitParameterID, inValue inValue: UnsafePointer<AudioUnitParameterValue>, outString outString: Unmanaged<CFString>!) }

    Objective-C

    typedef struct AudioUnitParameterStringFromValue { AudioUnitParameterID inParamID; const AudioUnitParameterValue *inValue; CFStringRef outString; } AudioUnitParameterStringFromValue;

    Availability

    Available in iOS 8.0 and later.

  • A parameter's value based on a string representation of the value.

    Declaration

    Swift

    struct AudioUnitParameterValueFromString { var inParamID: AudioUnitParameterID var inString: Unmanaged<CFString>! var outValue: AudioUnitParameterValue init() init(inParamID inParamID: AudioUnitParameterID, inString inString: Unmanaged<CFString>!, outValue outValue: AudioUnitParameterValue) }

    Objective-C

    typedef struct AudioUnitParameterValueFromString { AudioUnitParameterID inParamID; CFStringRef inString; AudioUnitParameterValue outValue; } AudioUnitParameterValueFromString;

    Availability

    Available in iOS 8.0 and later.

  • The suggested update rate and history duration for parameters which have the kAudioUnitParameterFlag_PlotHistory flag set.

    Declaration

    Swift

    struct AudioUnitParameterHistoryInfo { var updatesPerSecond: Float32 var historyDurationInSeconds: Float32 init() init(updatesPerSecond updatesPerSecond: Float32, historyDurationInSeconds historyDurationInSeconds: Float32) }

    Objective-C

    typedef struct AudioUnitParameterHistoryInfo { Float32 updatesPerSecond; Float32 historyDurationInSeconds; } AudioUnitParameterHistoryInfo;

    Discussion

    The structure is filled out by getting the value of the kAudioUnitProperty_ParameterHistoryInfo property.

    Availability

    Available in iOS 4.3 and later.

  • The callback function and custom data for providing input-to-output sample mapping for an audio unit.

    Declaration

    Swift

    struct AUInputSamplesInOutputCallbackStruct { var inputToOutputCallback: AUInputSamplesInOutputCallback var userData: UnsafeMutablePointer<Void> init() init(inputToOutputCallback inputToOutputCallback: AUInputSamplesInOutputCallback, userData userData: UnsafeMutablePointer<Void>) }

    Objective-C

    typedef struct AUInputSamplesInOutputCallbackStruct { AUInputSamplesInOutputCallback inputToOutputCallback; void *userData; } AUInputSamplesInOutputCallbackStruct;

    Fields

    inputToOutputCallback

    The callback function that provides input-to-output sample mapping for an audio unit.

    userData

    Custom data for input-to-output sample mapping for an audio unit.

    Availability

    Available in iOS 6.0 and later.

  • Used to set factory presets for an audio unit.

    Declaration

    Swift

    struct AUPreset { var presetNumber: Int32 var presetName: Unmanaged<CFString>! init() init(presetNumber presetNumber: Int32, presetName presetName: Unmanaged<CFString>!) }

    Objective-C

    typedef struct AUPreset { SInt32 presetNumber; CFStringRef presetName; } AUPreset;

    Fields

    presetNumber

    If less than 0, then the preset is a user preset. If greater than or equal to 0, then this field is used to select a factory preset.

    presetName

    If a factory preset, the name of the specified factory preset.

    Availability

    Available in iOS 2.0 and later.

  • Used for registering an input callback function with an audio unit.

    Declaration

    Swift

    struct AURenderCallbackStruct { var inputProc: AURenderCallback var inputProcRefCon: UnsafeMutablePointer<Void> init() init(inputProc inputProc: AURenderCallback, inputProcRefCon inputProcRefCon: UnsafeMutablePointer<Void>) }

    Objective-C

    typedef struct AURenderCallbackStruct { AURenderCallback inputProc; void *inputProcRefCon; } AURenderCallbackStruct;

    Fields

    inputProc

    inputProcRefCon

    Availability

    Available in iOS 2.0 and later.

  • The time- and transport-related callback functions for an audio unit.

    Declaration

    Swift

    struct HostCallbackInfo { var hostUserData: UnsafeMutablePointer<Void> var beatAndTempoProc: HostCallback_GetBeatAndTempo var musicalTimeLocationProc: HostCallback_GetMusicalTimeLocation var transportStateProc: HostCallback_GetTransportState var transportStateProc2: HostCallback_GetTransportState2 init() init(hostUserData hostUserData: UnsafeMutablePointer<Void>, beatAndTempoProc beatAndTempoProc: HostCallback_GetBeatAndTempo, musicalTimeLocationProc musicalTimeLocationProc: HostCallback_GetMusicalTimeLocation, transportStateProc transportStateProc: HostCallback_GetTransportState, transportStateProc2 transportStateProc2: HostCallback_GetTransportState2) }

    Objective-C

    typedef struct HostCallbackInfo { void *hostUserData; HostCallback_GetBeatAndTempo beatAndTempoProc; HostCallback_GetMusicalTimeLocation musicalTimeLocationProc; HostCallback_GetTransportState transportStateProc; } HostCallbackInfo;

    Fields

    hostUserData

    Custom data specified by your application. May be NULL.

    beatAndTempoProc

    Your callback function that provides beat and tempo information to an audio unit. May be NULL.

    musicalTimeLocationProc

    Your callback function that provides musical timeline information to an audio unit. May be NULL.

    transportStateProc

    Your callback function that provides audio transport state information (play, rewind, and so on) to an audio unit. May be NULL.

    Availability

    Available in iOS 5.0 and later.

  • Declaration

    Swift

    struct MixerDistanceParams { var mReferenceDistance: Float32 var mMaxDistance: Float32 var mMaxAttenuation: Float32 init() init(mReferenceDistance mReferenceDistance: Float32, mMaxDistance mMaxDistance: Float32, mMaxAttenuation mMaxAttenuation: Float32) }

    Objective-C

    typedef struct MixerDistanceParams { Float32 mReferenceDistance; Float32 mMaxDistance; Float32 mMaxAttenuation; // in decibels } MixerDistanceParams;

    Fields

    mReferenceDistance

    mMaxDistance

    mMaxAttenuation

    Availability

    Available in iOS 2.0 and later.

  • Declaration

    Objective-C

    struct ScheduledAudioFileRegion { AudioTimeStamp mTimeStamp; ScheduledAudioFileRegionCompletionProc mCompletionProc; void *mCompletionProcUserData; struct OpaqueAudioFileID *mAudioFile; UInt32 mLoopCount; SInt64 mStartFrame; UInt32 mFramesToPlay; };

    Fields

    mTimeStamp

    mCompletionProc

    may be NULL

    mCompletionProcUserData

    mAudioFile

    Must be a valid and already-open audio file object (of type AudioFileID), as declared in AudioToolbox/AudioFile.h.

    mLoopCount

    0 = do not loop

    mStartFrame

    The frame offset into the file.

    mFramesToPlay

    The number of frames to play.

Constants

  • Programmatic roles and contexts for audio unit properties.

    Declaration

    Swift

    var kAudioUnitScope_Global: Int { get } var kAudioUnitScope_Input: Int { get } var kAudioUnitScope_Output: Int { get } var kAudioUnitScope_Group: Int { get } var kAudioUnitScope_Part: Int { get } var kAudioUnitScope_Note: Int { get }

    Objective-C

    enum { kAudioUnitScope_Global = 0, kAudioUnitScope_Input = 1, kAudioUnitScope_Output = 2, kAudioUnitScope_Group = 3, kAudioUnitScope_Part = 4, kAudioUnitScope_Note = 5 };

    Constants

    • kAudioUnitScope_Global

      kAudioUnitScope_Global

      The context for audio unit characteristics that apply to the audio unit as a whole.

      Available in iOS 2.0 and later.

    • kAudioUnitScope_Input

      kAudioUnitScope_Input

      The context for audio data coming into an audio unit.

      Available in iOS 2.0 and later.

    • kAudioUnitScope_Output

      kAudioUnitScope_Output

      The context for audio data leaving an audio unit.

      Available in iOS 2.0 and later.

    • kAudioUnitScope_Group

      kAudioUnitScope_Group

      In OS X, a context specific to the control scope of audio unit parameters.

      Available in iOS 5.0 and later.

    • kAudioUnitScope_Part

      kAudioUnitScope_Part

      In OS X, a distinct rendering context; for example, a single timbre in a multitimbral instrument or a single loop in a multi-looping-capable looper unit.

      Available in iOS 5.0 and later.

    • kAudioUnitScope_Note

      kAudioUnitScope_Note

      In OS X, a scope for changes to an individual musical note. The element identifier used with this scope is the unique note identifier returned from a started note (see the MusicDeviceStartNote function in AudioUnit/MusicDevice.h).

      Available in iOS 5.0 and later.

    Discussion

    Each audio unit scope is a discrete programmatic context. Apple reserves scope identifiers from 0 through 1024.

  • Properties that apply to any audio unit.

    Declaration

    Swift

    var kAudioUnitProperty_ClassInfo: Int { get } var kAudioUnitProperty_MakeConnection: Int { get } var kAudioUnitProperty_SampleRate: Int { get } var kAudioUnitProperty_ParameterList: Int { get } var kAudioUnitProperty_ParameterInfo: Int { get } var kAudioUnitProperty_StreamFormat: Int { get } var kAudioUnitProperty_ElementCount: Int { get } var kAudioUnitProperty_Latency: Int { get } var kAudioUnitProperty_SupportedNumChannels: Int { get } var kAudioUnitProperty_MaximumFramesPerSlice: Int { get } var kAudioUnitProperty_AudioChannelLayout: Int { get } var kAudioUnitProperty_TailTime: Int { get } var kAudioUnitProperty_BypassEffect: Int { get } var kAudioUnitProperty_LastRenderError: Int { get } var kAudioUnitProperty_SetRenderCallback: Int { get } var kAudioUnitProperty_FactoryPresets: Int { get } var kAudioUnitProperty_RenderQuality: Int { get } var kAudioUnitProperty_InPlaceProcessing: Int { get } var kAudioUnitProperty_ElementName: Int { get } var kAudioUnitProperty_SupportedChannelLayoutTags: Int { get } var kAudioUnitProperty_PresentPreset: Int { get } var kAudioUnitProperty_ShouldAllocateBuffer: Int { get } var kAudioUnitProperty_ParameterHistoryInfo: Int { get } var kAudioUnitProperty_FrequencyResponse: Int { get } var kAudioUnitProperty_CPULoad: Int { get } var kAudioUnitProperty_ParameterValueStrings: Int { get } var kAudioUnitProperty_HostCallbacks: Int { get } var kAudioUnitProperty_ParameterStringFromValue: Int { get } var kAudioUnitProperty_ParameterIDName: Int { get } var kAudioUnitProperty_OfflineRender: Int { get } var kAudioUnitProperty_ParameterValueFromString: Int { get } var kAudioUnitProperty_DependentParameters: Int { get } var kAudioUnitProperty_InputSamplesInOutput: Int { get }

    Objective-C

    enum { kAudioUnitProperty_ClassInfo = 0, kAudioUnitProperty_MakeConnection = 1, kAudioUnitProperty_SampleRate = 2, kAudioUnitProperty_ParameterList = 3, kAudioUnitProperty_ParameterInfo = 4, kAudioUnitProperty_StreamFormat = 8, kAudioUnitProperty_ElementCount = 11, kAudioUnitProperty_Latency = 12, kAudioUnitProperty_SupportedNumChannels = 13, kAudioUnitProperty_MaximumFramesPerSlice = 14, kAudioUnitProperty_AudioChannelLayout = 19, kAudioUnitProperty_TailTime = 20, kAudioUnitProperty_BypassEffect = 21, kAudioUnitProperty_LastRenderError = 22, kAudioUnitProperty_SetRenderCallback = 23, kAudioUnitProperty_FactoryPresets = 24, kAudioUnitProperty_RenderQuality = 26, kAudioUnitProperty_InPlaceProcessing = 29, kAudioUnitProperty_ElementName = 30, kAudioUnitProperty_SupportedChannelLayoutTags = 32, kAudioUnitProperty_PresentPreset = 36, kAudioUnitProperty_ShouldAllocateBuffer = 51, kAudioUnitProperty_ParameterHistoryInfo = 53, kAudioUnitProperty_CPULoad = 6, kAudioUnitProperty_ParameterValueStrings = 16, kAudioUnitProperty_HostCallbacks = 27, kAudioUnitProperty_ParameterStringFromValue = 33, kAudioUnitProperty_ParameterIDName = 34, kAudioUnitProperty_OfflineRender = 37, kAudioUnitProperty_ParameterValueFromString = 38, kAudioUnitProperty_DependentParameters = 45, kAudioUnitProperty_InputSamplesInOutput = 49, kAudioUnitProperty_FrequencyResponse = 52 };

    Constants

    • kAudioUnitProperty_ClassInfo

      kAudioUnitProperty_ClassInfo

      Describes the state of an audio unit.

      A read/write CFDictionaryRef object valid on the audio unit global scope. An OS X audio unit that supports the part scope may, in addition, support presets on that scope that apply to individual parts.

      When assigning a class information dictionary to an audio unit with the AudioUnitSetProperty function, you own the reference to the dictionary and are responsible for later releasing it by calling the CFRelease function.

      When obtaining a class information dictionary from an audio unit with the AudioUnitGetProperty function, you also own the reference to the dictionary and are responsible for later releasing it by calling the CFRelease function.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_MakeConnection

      kAudioUnitProperty_MakeConnection

      A write-only AudioUnitConnection data structure valid on the audio unit input scope.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_SampleRate

      kAudioUnitProperty_SampleRate

      A read/write Float64 value valid on the audio unit input and output scopes.

      The audio sample rate for a specified scope.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_ParameterList

      kAudioUnitProperty_ParameterList

      A list of read-only AudioUnitParameterID values valid on any audio unit scope.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_ParameterInfo

      kAudioUnitProperty_ParameterInfo

      A read-only AudioUnitParameterInfo data structure valid on any audio unit scope.

      Characteristics for an audio unit parameter including minimum, maximum, and default values; full parameter name; and so on. For a shortened version of an audio unit parameter name suitable for compact display situations, see the kAudioUnitProperty_ParameterIDName property.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_StreamFormat

      kAudioUnitProperty_StreamFormat

      The audio data stream format for an audio unit input or output element (also called bus).

      A read/write AudioStreamBasicDescription data structure valid on the audio unit input and output scopes.

      An AudioStreamBasicDescription struct does not specify channel layout or purpose. To specify a channel layout, use the kAudioUnitProperty_AudioChannelLayout property.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_ElementCount

      kAudioUnitProperty_ElementCount

      A read/write UInt32 value valid on any audio unit scope. The global audio unit scope always has an element count of 1.

      Most audio units implement this property as read-only, indicating that they use a fixed number of input and output buses. An audio unit implemented to support adding and removing buses implements this property as read/write.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_Latency

      kAudioUnitProperty_Latency

      A read-only Float64 value valid on the audio unit global scope.

      The time, in seconds, that it takes an audio unit to move an audio sample from its input to its output.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_SupportedNumChannels

      kAudioUnitProperty_SupportedNumChannels

      A read-only array of AUChannelInfo structures valid on the audio unit global scope.

      The size of the array indicates the number of AUChannelInfo structures for an audio unit. Each structure describes the channel configuration for an audio input/output bus. For example, the values (2, 2) indicates a channel configuration of two input channels paired to two output channels on a bus.

      A negative value for a field in an AUChannelInfo structure indicates that an input/output bus supports a variable number of channels, as follows:

      • {–1, –1} indicates that a bus supports any number of input or output channels provided that the input and output channel counts match each other. This is the default configuration for effect units.

      • {–1, –2} or {–2, –1} indicates that a bus supports any number of input and output channels; the channel counts on input and output can differ from each other.

      • {–1, –3} indicates that a bus supports any number of input channels and up to three output channels.

      A value of 0 for the inChannels field means that an audio unit does not have any audio input buses.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_MaximumFramesPerSlice

      kAudioUnitProperty_MaximumFramesPerSlice

      Specifies the maximum number of sample frames an audio unit is prepared to supply on one invocation of its AudioUnitRender function.

      A read/write UInt32 value valid on the audio unit global scope.

      The default value of this property is 1,024, corresponding to about 23 ms at a 44.1 kHz sample rate. This default value is sufficient when a host app is using the default hardware buffer size and the device screen is not sleeping. When the device screen sleeps, the system saves power by reducing the frequency at which it requests sample frames. There is a corresponding increase in the number of sample frames requested of an audio unit, per render call.

      The following table provides some common slice sizes:

      Frame count

      Milliseconds at 44.1 kHz (approximate)

      1024

      23

      4096

      93

      256

      5

      You never need to set this property for I/O units because they are preconfigured to handle any slice size requested by the system. For all other audio units, you must set this property to a value of 4096 to handle screen sleep—unless audio input is running on the device. When audio input is running, the system maintains a slice size of 1024.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_AudioChannelLayout

      kAudioUnitProperty_AudioChannelLayout

      A read/write AudioChannelLayout data structure valid on the audio unit input and output scopes.

      The channel order, within a given audio stream, for a specified audio unit element and scope. The number of channels in the layout must match the number of channels set for the scope-element. Each input and output bus in an audio unit can have one instance of this property.

      Some audio units require this property. For example, the 3DMixer unit must implement this property on its output bus. If a host application attempts to clear the value of this property on a bus that requires a valid value, the audio unit will return a kAudioUnitErr_InvalidPropertyValue error.

      Input and output buses can be in one of three states in regard to Audio channel layout:

      1. Implemented and set

      2. Implemented but not set

      3. Unimplemented

      Requesting the value of this property when it is implemented but not set results in a kAudioUnitErr_PropertyNotInUse error.

      Use the kAudioUnitProperty_AudioChannelLayout property whenever channel layout is relevant.

      For related information, refer to the descriptions for the ScheduledAudioFileRegion and AudioOutputUnitStartAtTimeParams data structures.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_TailTime

      kAudioUnitProperty_TailTime

      A read-only Float64 value valid on the audio unit global scope.

      Indicates a time estimate, in seconds, between the last valid input being received by an audio unit and the audio unit’s output becoming silent. For example, a reverb unit’s tail time estimates the “decay” time. The tail time value is usually a conservative estimate that you can depend on.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_BypassEffect

      kAudioUnitProperty_BypassEffect

      A read/write UInt32 value, representing a Boolean value, valid on the audio unit global scope.

      Indicates if an audio unit’s processing code is being bypassed (1) or not (0).

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_LastRenderError

      kAudioUnitProperty_LastRenderError

      A read-only OSStatus value valid on the audio unit global scope.

      This property is set if a call to the AudioUnitRender function returns an error. To be notified of errors, register a callback function as a property listener using the AudioUnitAddPropertyListener function.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_SetRenderCallback

      kAudioUnitProperty_SetRenderCallback

      A write-only AURenderCallbackStruct data structure valid on the audio unit input scope.

      Set this property to specify your callback function that provides audio samples to an audio unit. When you call the AudioUnitSetProperty function from your application to assign the callback, you specify the input bus that the callback applies to. See the AURenderCallback callback function.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_FactoryPresets

      kAudioUnitProperty_FactoryPresets

      So-called factory presets (as opposed to user-configured presets) are ones supplied with an audio unit by the manufacturer. You choose the active preset by setting the kAudioUnitProperty_PresentPreset property.

      A read-only CFArrayRef array of AUPreset structures.

      When obtaining a factory preset array from an audio unit with the AudioUnitGetProperty function, you own the reference to the array and are responsible for later releasing it by calling the CFRelease function.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_RenderQuality

      kAudioUnitProperty_RenderQuality

      A read/write UInt32 value valid on the audio unit global scope.

      A value in the range 0 through 127 that indicates an audio unit’s rendering quality. You should set this property to its maximum value unless doing so results in excessive CPU usage.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_InPlaceProcessing

      kAudioUnitProperty_InPlaceProcessing

      A read/write UInt32 value, representing a Boolean value, valid on the audio unit global scope.

      Indicates whether an audio unit can process input data directly within its input buffer (1) or not (0). You may want to disable in-place processing to allow your host application to manage the processing buffers.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_ElementName

      kAudioUnitProperty_ElementName

      The name of the specified element.

      A read/write CFStringRef object valid on any audio unit scope.

      When assigning an element name string to an audio unit with the AudioUnitSetProperty function, you own the reference to the name and are responsible for later releasing it by calling the CFRelease function.

      When obtaining an element name string from an audio unit with the AudioUnitGetProperty function, you also own the reference to the name and are responsible for later releasing it by calling the CFRelease function.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_SupportedChannelLayoutTags

      kAudioUnitProperty_SupportedChannelLayoutTags

      A read only array on AudioChannelLayoutTag structures, valid on the audio unit input and output scopes.

      Used with GetProperty to ascertain what an audio unit understands about laying out of channel orders. This will normally return one or more of the specified layout tags.

      When a specific set of layouts are returned, the client then uses the kAudioUnitProperty_AudioChannelLayout property (with one of those layout tags specified) to set the unit to use that layout. In this case the client (and the audio unit when reporting its AudioChannelLayout) is only expected to have set an AudioChannelLayout which only sets the layout tag as the valid field.

      Some audio units may return the tag kAudioChannelLayoutTag_UseChannelDescriptions. This indicates a custom channel map.

      In this case, the host then can look at supported number of channels on that scope (using the kAudioUnitProperty_SupportedNumChannels), and supply an AudioChannelLayout with the kAudioUnitProperty_AudioChannelLayout property to specify the layout, number of channels and location of each of those channels. This custom channel map MUST have a channel valence that is supported by the Audio Unit.

      The UseChannelBitmap field is NOT used within the context of the AudioUnit.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_PresentPreset

      kAudioUnitProperty_PresentPreset

      The active factory preset for an audio unit.

      A read/write AUPreset data structure valid on the audio unit global scope, The presetName field in the struct is of type CFStringRef and follows Core Foundation memory semantics.

      When setting the active factory preset on an audio unit with the AudioUnitSetProperty function, you own the reference to the preset name and are responsible for later releasing it by calling the CFRelease function.

      When obtaining the active factory preset from an audio unit with the AudioUnitGetProperty function, you also own the reference to the preset name and are responsible for later releasing it by calling the CFRelease function.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_ShouldAllocateBuffer

      kAudioUnitProperty_ShouldAllocateBuffer

      A read/write UInt32 value valid on the audio unit input and output scopes, settable individually on each element.

      Default value is true, which means that the associated audio unit element creates a buffer for rendering into.

      If true, the element will create a buffer for rendering into.

      If false, the element will not create a buffer for rendering.

      For example, if the audio unit is only ever going to have a connection as its input and never a callback, then it should not need to create a buffer (the API contract expects an audio unit to provide a buffer for callbacks, but no buffer for connections).

      If the audio unit is always going to be pulled for audio with the client providing audio data buffers to the AudioUnitRender call, then it will never need to create an audio buffer on the output side.

      So, this property can be used to control the default allocation strategy of an audio unit. If the audio unit needs a buffer, but one hasn't been allocated, then an error will be thrown from that call to AudioUnitRender.

      This property cannot be set on initialized audio units as it may end up reallocating memory.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_ParameterHistoryInfo

      kAudioUnitProperty_ParameterHistoryInfo

      For parameters that have the kAudioUnitParameterFlag_PlotHistory flag set, getting this property fills out the AudioUnitParameterHistoryInfo struct containing the recommended update rate and history duration.

      Available in iOS 4.3 and later.

    • kAudioUnitProperty_FrequencyResponse

      kAudioUnitProperty_FrequencyResponse

      Available in iOS 2.1 and later.

    • kAudioUnitProperty_CPULoad

      kAudioUnitProperty_CPULoad

      A read-only Float64 value valid on the audio unit global scope.

      The proportion of time that an audio unit is devoting to audio rendering. The value ranges from 0.0 (the audio unit is spending no time rendering) through 1.0 (the audio unit is spending all of its time rendering).

      Available in iOS 5.0 and later.

    • kAudioUnitProperty_ParameterValueStrings

      kAudioUnitProperty_ParameterValueStrings

      An array of names for a named, indexed audio unit parameter. An indexed parameter is one whose unit type is kAudioUnitParameterUnit_Indexed. The array’s strings can be used to build a menu for the parameter.

      A read-only CFArrayRef object whose elements are CFStringRef objects, valid on any audio unit scope.

      When obtaining a parameter string array from an audio unit with the AudioUnitGetProperty function, you own the reference to the array and are responsible for later releasing it by calling the CFRelease function.

      Indexed parameters use whole-number index values; the size of this property’s array should be the same as the range between the parameter’s minimum and maximum values.

      Available in iOS 5.0 and later.

    • kAudioUnitProperty_HostCallbacks

      kAudioUnitProperty_HostCallbacks

      A write-only HostCallbackInfo data structure valid on the audio unit global scope.

      A set of callback functions that allow an audio unit to get information, from the host, that may be relevant to rendering. You write the callbacks to provide an audio unit with music control information including beat, tempo, and audio transport state.

      An audio unit should invoke host callbacks only from within its render function.

      Any of the parameters of the callback function, when called by the audio unit, can be NULL. This indicates that the unit doesn't want to know that particular information. The exception is that the unit must always specify the HostUserData which was be supplied to the unit when the property was set.

      If the host is unable to provide the requested information then it can return the kAudioUnitErr_CannotDoInCurrentContext error code.

      Available in iOS 5.0 and later.

    • kAudioUnitProperty_ParameterStringFromValue

      kAudioUnitProperty_ParameterStringFromValue

      A read-only AudioUnitParameterStringFromValue struct, valid on any audio unit scope.

      This property is used with parameters that are marked with the kAudioUnitParameterFlag_HasName parameter info flag. This indicates that some (or all) of the values represented by the parameter can and should be represented by a special display string.

      This is NOT to be confused with kAudioUnitProperty_ParameterValueStrings. That property is used with parameters that are indexed and is typically used for instance to build a menu item of choices for one of several parameter values.

      kAudioUnitProperty_ParameterStringFromValue can have a continuous range, and merely states to the host that if it is displaying those parameter's values, they should request a name any time any value of the parameter is set when displaying that parameter.

      For instance (a trivial example), a unit may present a gain parameter in a dB scale, and wish to display its minimum value as "negative infinity". In this case, the audio unit will not return names for any parameter value greater than its minimum value - so the host will then just display the parameter value as is. For values less than or equal to the minimum value, the audio unit will return a string for "negative infinity" which the host can use to display appropriately.

      A less trivial example might be a parameter that presents its values as seconds. However, in some situations this value should be better displayed in a SMPTE style of display.

      • HH:MM:SS:FF

      In this case, the audio unit would return a name for any value of the parameter.

      The GetProperty call is used in the same scope and element as the inParamID that is declared in the struct passed in to this property.

      If the *inValue member is NULL, then the audio unit should take the current value of the specified parameter. If the *inValue member is NOT NULL, then the audio unit should return the name used for the specified value.

      On exit, the outName may point to a CFStringRef (which if so must be released by the caller). If the parameter has no special name that should be applied to that parameter value, then outName will be NULL, and the host should display the parameter value as appropriate.

      Available in iOS 8.0 and later.

    • kAudioUnitProperty_ParameterIDName

      kAudioUnitProperty_ParameterIDName

      A shortened version of an audio unit parameter name, suitable for compact display situations.

      In your host application, you specify the desired length for the shortened version of the name by setting the inDesiredLength field in this property. For the full-length version of an audio unit parameter name, see the kAudioUnitProperty_ParameterInfo property.

      Value is a read-only AudioUnitParameterNameInfo data structure, valid on any audio unit scope.

      Available in iOS 8.0 and later.

    • kAudioUnitProperty_OfflineRender

      kAudioUnitProperty_OfflineRender

      Available in iOS 6.0 and later.

    • kAudioUnitProperty_ParameterValueFromString

      kAudioUnitProperty_ParameterValueFromString

      Available in iOS 8.0 and later.

    • kAudioUnitProperty_DependentParameters

      kAudioUnitProperty_DependentParameters

      A read-only array of AUDependentParameter structs, valid on the audio unit global scope.

      This property is used for parameters with the kAudioUnitParameterFlag_IsGlobalMeta or kAudioUnitParameterFlag_IsElementMeta flags set. Hosts applications (and the AudioUnitParameterListener mechanism) can interrogate this property to determine which parameters are dependent on a meta-parameter.

      For parameters marked with kAudioUnitParameterFlag_IsGlobalMeta, any non-global dependent parameters are assumed to be dependent in every element of their scope.

      For parameters marked with kAudioUnitParameterFlag_IsElementMeta, then its dependent parameters must all be the same scope, and are assumed to apply only within a single element, not to other instances of the same parameter in other elements.

      Available in iOS 6.0 and later.

    • kAudioUnitProperty_InputSamplesInOutput

      kAudioUnitProperty_InputSamplesInOutput

      A read/write AUInputSamplesInOutputCallbackStruct struct, valid on the audio unit global scope.

      An audio unit calls this callback at the end of its render call. The audio unit supplies the following information:

      • outputTime - The timestamp passed in to the audio unit's render call. This timestamp represents the time of the first output sample.

      • inputSample - The sample number of the first input sample that is present in the output audio.

      • numInputSamples - The number of input samples that were used and are present in the output audio.

      This property allows a host application to determine which input samples correspond to a sample in the output buffer. It is useful only for audio units that do time-stretching, such as the OS X AUVaripseed and AUTimePitch units, where the relationship between input and output samples is non-trivial. For these units, the range of input samples that correspond to an output buffer typically differs from the range of input samples that were pulled for that render call. This difference arises because of internal buffering, processing latency, and other factors.

      Available in iOS 6.0 and later.

    Discussion

    The integer range for the set of generic audio unit property identifiers is 0 through 999.

  • Properties for Apple I/O audio units (sometimes called output units).

    Declaration

    Swift

    var kAudioOutputUnitProperty_CurrentDevice: Int { get } var kAudioOutputUnitProperty_IsRunning: Int { get } var kAudioOutputUnitProperty_ChannelMap: Int { get } var kAudioOutputUnitProperty_EnableIO: Int { get } var kAudioOutputUnitProperty_StartTime: Int { get } var kAudioOutputUnitProperty_SetInputCallback: Int { get } var kAudioOutputUnitProperty_HasIO: Int { get } var kAudioOutputUnitProperty_StartTimestampsAtZero: Int { get }

    Objective-C

    enum { kAudioOutputUnitProperty_CurrentDevice = 2000, kAudioOutputUnitProperty_IsRunning = 2001, kAudioOutputUnitProperty_ChannelMap = 2002, kAudioOutputUnitProperty_EnableIO = 2003, kAudioOutputUnitProperty_StartTime = 2004, kAudioOutputUnitProperty_SetInputCallback = 2005, kAudioOutputUnitProperty_HasIO = 2006, kAudioOutputUnitProperty_StartTimestampsAtZero = 2007 };

    Constants

    • kAudioOutputUnitProperty_CurrentDevice

      kAudioOutputUnitProperty_CurrentDevice

      A read/write audio device ID object, of type AudioDeviceID, valid on the audio unit global scope.

      Available in iOS 2.0 and later.

    • kAudioOutputUnitProperty_IsRunning

      kAudioOutputUnitProperty_IsRunning

      Indicates whether an audio unit is running (TRUE) or not (FALSE).

      Available in iOS 2.0 and later.

    • kAudioOutputUnitProperty_ChannelMap

      kAudioOutputUnitProperty_ChannelMap

      Maps input channels from an input (source) to an output (destination). The number of channels represented in the channel map is the number of channels of the destination. The channel map entries contain a channel number of the source that should be mapped to that destination channel. If -1 is specified, than that destination channel will not contain any channel from the source (so it will be silent). This will also work with the AUConverter unit.

      Available in iOS 2.0 and later.

    • kAudioOutputUnitProperty_EnableIO

      kAudioOutputUnitProperty_EnableIO

      Specifies whether audio I/O is enabled for an I/O unit bus-scope combination.

      An I/O unit’s bus 0 connects to output hardware, such as for playback through a speaker. Output is enabled by default. To disable output, the bus 0 output scope must be disabled, as follows:

      • UInt32 enableOutput = 0; // to disable output
      • AudioUnitElement outputBus = 0;
      • AudioUnitSetProperty (
      • io_unit_instance,
      • kAudioOutputUnitProperty_EnableIO,
      • kAudioUnitScope_Output,
      • outputBus,
      • &enableOutput,
      • sizeof (enableOutput)
      • );

      An I/O unit’s bus 1 connects to input hardware, such as for recording from a microphone. Input is disabled by default. To enable input, the bus 1 input scope must be enabled, as follows:

      • UInt32 enableInput = 1; // to enable input
      • AudioUnitElement inputBus = 1;
      • AudioUnitSetProperty (
      • io_unit_instance,
      • kAudioOutputUnitProperty_EnableIO,
      • kAudioUnitScope_Input,
      • inputBus,
      • &enableInput,
      • sizeof (enableInput)
      • );

      A read/write UInt32 value valid on the input and output scopes.

      Available in iOS 2.0 and later.

    • kAudioOutputUnitProperty_StartTime

      kAudioOutputUnitProperty_StartTime

      A write-only AudioOutputUnitStartAtTimeParams data structure valid on the audio unit global scope. When this property is set on an output unit, it will cause the next Start request (but no subsequent Starts) to use the AudioDeviceStartAtTime function, using the specified timestamp, passing false for inRequestedStartTimeIsInput.

      Available in iOS 2.0 and later.

    • kAudioOutputUnitProperty_SetInputCallback

      kAudioOutputUnitProperty_SetInputCallback

      A read/write AURenderCallbackStruct data structure valid on the audio unit global scope. When an output unit has been enabled for input operation, this callback can be used to provide a single callback to the host application from the input I/O proc, in order to notify the host that input is available and may be obtained by calling the AudioUnitRender function.

      Available in iOS 2.0 and later.

    • kAudioOutputUnitProperty_HasIO

      kAudioOutputUnitProperty_HasIO

      A UInt32 value. Scope: { scope output, element 0 = output } { scope input, element 1 = input }. Value is 1 if input or output is enabled on the specified element. See kAudioOutputUnitProperty_EnableIO.

      Available in iOS 2.0 and later.

    • kAudioOutputUnitProperty_StartTimestampsAtZero

      kAudioOutputUnitProperty_StartTimestampsAtZero

      A read/write UInt32 value valid on the audio unit global scope.

      Available in iOS 2.0 and later.

  • Properties that apply to the Apple voice-processing I/O audio unit.

    Declaration

    Swift

    var kAUVoiceIOProperty_BypassVoiceProcessing: Int { get } var kAUVoiceIOProperty_VoiceProcessingEnableAGC: Int { get } var kAUVoiceIOProperty_MuteOutput: Int { get }

    Objective-C

    enum { kAUVoiceIOProperty_BypassVoiceProcessing = 2100, kAUVoiceIOProperty_VoiceProcessingEnableAGC = 2101, kAUVoiceIOProperty_MuteOutput = 2104, };

    Constants

    • kAUVoiceIOProperty_BypassVoiceProcessing

      kAUVoiceIOProperty_BypassVoiceProcessing

      Indicates whether voice processing is bypassed (any nonzero value) or active (a value of 0). Voice processing is active by default.

      Value is a read/write UInt32 valid on the global audio unit scope.

      Available in iOS 3.0 and later.

    • kAUVoiceIOProperty_VoiceProcessingEnableAGC

      kAUVoiceIOProperty_VoiceProcessingEnableAGC

      Indicates whether automatic gain control is enabled (any nonzero value) or disabled (a value of 0). Automatic gain control is enabled by default.

      Value is a read/write UInt32 valid on the global audio unit scope.

      Available in iOS 3.0 and later.

    • kAUVoiceIOProperty_MuteOutput

      kAUVoiceIOProperty_MuteOutput

      Mutes the output of the Voice-Processing I/O unit. Output muting is off (0) by default. To mute the output, set this property’s value to 1.

      Value is a read/write UInt32 valid on the global audio unit scope.

      Available in iOS 4.0 and later.

  • Properties for Apple mixer audio units.

    Declaration

    Swift

    var kAudioUnitProperty_MeteringMode: Int { get } var kAudioUnitProperty_MatrixLevels: Int { get } var kAudioUnitProperty_MatrixDimensions: Int { get } var kAudioUnitProperty_MeterClipping: Int { get }

    Objective-C

    enum { // For general mixers kAudioUnitProperty_MeteringMode = 3007, // For the matrix mixer kAudioUnitProperty_MatrixLevels = 3006, kAudioUnitProperty_MatrixDimensions = 3009, kAudioUnitProperty_MeterClipping = 3011 };

    Constants

    • kAudioUnitProperty_MeteringMode

      kAudioUnitProperty_MeteringMode

      Specifies whether metering is enabled or disabled for a particular scope-element combination.

      A read/write UInt32 value valid on the input and output scopes.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_MatrixLevels

      kAudioUnitProperty_MatrixLevels

      Describes the internal state of a matrix mixer.

      Calculate the size required for this property’s value as follows:

      • (input channel count + 1) * (output channel count + 1)

      Obtain the channel counts using the kAudioUnitProperty_MatrixDimensions property.

      For example, consider a matrix mixer that has 2 input channels and 2 output channels. The value of this property then requires a 3 x 3 array of Float32 values. You can retrieve specific pieces of information for this example matrix mixer’s state as follows:

      • Global volume is stored at volumes[2][2]

      • Input volumes are stored in the last column: first input channel at volumes[0][2]; second input channel at volumes[1][2]

      • Output volumes are stored in the last row: first output channel at volumes [2][0]; second output channel at volumes[2][1]

      • Cross-point volumes are stored at their expected locations(volumes[0][1], etc)

      A read-only two-dimensional array of Float32 values valid on the audio unit global scope.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_MatrixDimensions

      kAudioUnitProperty_MatrixDimensions

      Indicates the total number of channels for input and output of a given matrix mixer.

      A read-only 2 * UInt32 value valid on the audio unit global scope.

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_MeterClipping

      kAudioUnitProperty_MeterClipping

      Indicates audio clipping that has occurred since this property was last accessed.

      A read-only AudioUnitMeterClipping data structure valid on the audio unit global scope.

      Available in iOS 2.0 and later.

  • Properties for the Apple 3D Mixer audio unit.

    Declaration

    Swift

    var kAudioUnitProperty_3DMixerDistanceParams: Int { get } var kAudioUnitProperty_3DMixerAttenuationCurve: Int { get } var kAudioUnitProperty_SpatializationAlgorithm: Int { get } var kAudioUnitProperty_DopplerShift: Int { get } var kAudioUnitProperty_3DMixerRenderingFlags: Int { get } var kAudioUnitProperty_3DMixerDistanceAtten: Int { get } var kAudioUnitProperty_ReverbPreset: Int { get }

    Objective-C

    enum { kAudioUnitProperty_3DMixerDistanceParams = 3010, kAudioUnitProperty_3DMixerAttenuationCurve = 3013, kAudioUnitProperty_SpatializationAlgorithm = 3000, kAudioUnitProperty_DopplerShift = 3002, kAudioUnitProperty_3DMixerRenderingFlags = 3003, kAudioUnitProperty_3DMixerDistanceAtten = 3004, kAudioUnitProperty_ReverbPreset = 3012 };

    Constants

    • kAudioUnitProperty_3DMixerDistanceParams

      kAudioUnitProperty_3DMixerDistanceParams

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_3DMixerAttenuationCurve

      kAudioUnitProperty_3DMixerAttenuationCurve

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_SpatializationAlgorithm

      kAudioUnitProperty_SpatializationAlgorithm

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_DopplerShift

      kAudioUnitProperty_DopplerShift

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_3DMixerRenderingFlags

      kAudioUnitProperty_3DMixerRenderingFlags

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_3DMixerDistanceAtten

      kAudioUnitProperty_3DMixerDistanceAtten

      Available in iOS 2.0 and later.

    • kAudioUnitProperty_ReverbPreset

      kAudioUnitProperty_ReverbPreset

      Available in iOS 2.0 and later.

  • Audio level attenuation curves to use with the Apple 3D Mixer audio unit.

    Declaration

    Swift

    var k3DMixerAttenuationCurve_Power: Int { get } var k3DMixerAttenuationCurve_Exponential: Int { get } var k3DMixerAttenuationCurve_Inverse: Int { get } var k3DMixerAttenuationCurve_Linear: Int { get }

    Objective-C

    enum { k3DMixerAttenuationCurve_Power = 0, k3DMixerAttenuationCurve_Exponential = 1, k3DMixerAttenuationCurve_Inverse = 2, k3DMixerAttenuationCurve_Linear = 3 };

    Constants

    • k3DMixerAttenuationCurve_Power

      k3DMixerAttenuationCurve_Power

      An equal-power-based attenuation curve.

      Available in iOS 2.0 and later.

    • k3DMixerAttenuationCurve_Exponential

      k3DMixerAttenuationCurve_Exponential

      An exponential attenuation curve.

      Available in iOS 2.0 and later.

    • k3DMixerAttenuationCurve_Inverse

      k3DMixerAttenuationCurve_Inverse

      An inverse attenuation curve.

      Available in iOS 2.0 and later.

    • k3DMixerAttenuationCurve_Linear

      k3DMixerAttenuationCurve_Linear

      A linear attenuation curve.

      Available in iOS 2.0 and later.

  • Rendering options for the Apple 3D Mixer audio unit.

    Declaration

    Swift

    var k3DMixerRenderingFlags_InterAuralDelay: Int { get } var k3DMixerRenderingFlags_DopplerShift: Int { get } var k3DMixerRenderingFlags_DistanceAttenuation: Int { get } var k3DMixerRenderingFlags_DistanceFilter: Int { get } var k3DMixerRenderingFlags_DistanceDiffusion: Int { get } var k3DMixerRenderingFlags_LinearDistanceAttenuation: Int { get } var k3DMixerRenderingFlags_ConstantReverbBlend: Int { get }

    Objective-C

    enum { k3DMixerRenderingFlags_InterAuralDelay = (1L << 0), k3DMixerRenderingFlags_DopplerShift = (1L << 1), k3DMixerRenderingFlags_DistanceAttenuation = (1L << 2), k3DMixerRenderingFlags_DistanceFilter = (1L << 3), k3DMixerRenderingFlags_DistanceDiffusion = (1L << 4), k3DMixerRenderingFlags_LinearDistanceAttenuation = (1L << 5), k3DMixerRenderingFlags_ConstantReverbBlend = (1L << 6) };

    Constants

    • k3DMixerRenderingFlags_InterAuralDelay

      k3DMixerRenderingFlags_InterAuralDelay

      Available in iOS 2.0 and later.

    • k3DMixerRenderingFlags_DopplerShift

      k3DMixerRenderingFlags_DopplerShift

      Available in iOS 2.0 and later.

    • k3DMixerRenderingFlags_DistanceAttenuation

      k3DMixerRenderingFlags_DistanceAttenuation

      Available in iOS 2.0 and later.

    • k3DMixerRenderingFlags_DistanceFilter

      k3DMixerRenderingFlags_DistanceFilter

      Available in iOS 2.0 and later.

    • k3DMixerRenderingFlags_DistanceDiffusion

      k3DMixerRenderingFlags_DistanceDiffusion

      Available in iOS 2.0 and later.

    • k3DMixerRenderingFlags_LinearDistanceAttenuation

      k3DMixerRenderingFlags_LinearDistanceAttenuation

      Available in iOS 2.0 and later.

    • k3DMixerRenderingFlags_ConstantReverbBlend

      k3DMixerRenderingFlags_ConstantReverbBlend

      Available in iOS 2.0 and later.

  • Properties for the Apple AUConverter audio unit.

    Declaration

    Swift

    var kAudioUnitProperty_SampleRateConverterComplexity: Int { get }

    Objective-C

    enum { kAudioUnitProperty_SampleRateConverterComplexity = 3014 };

    Constants

    • kAudioUnitProperty_SampleRateConverterComplexity

      kAudioUnitProperty_SampleRateConverterComplexity

      The quality of sample-rate conversion for the audio unit to perform. A UInt32 value valid on the audio unit global scope.

      Available in iOS 2.0 and later.

  • Quality levels for the audio sample-rate conversion algorithm.

    Declaration

    Swift

    var kAudioUnitSampleRateConverterComplexity_Linear: Int { get } var kAudioUnitSampleRateConverterComplexity_Normal: Int { get } var kAudioUnitSampleRateConverterComplexity_Mastering: Int { get }

    Objective-C

    enum { kAudioUnitSampleRateConverterComplexity_Linear = 'line', kAudioUnitSampleRateConverterComplexity_Normal = 'norm', kAudioUnitSampleRateConverterComplexity_Mastering = 'bats' };

    Constants

    • kAudioUnitSampleRateConverterComplexity_Linear

      kAudioUnitSampleRateConverterComplexity_Linear

      Basic sample rate conversion using linear interpolation. Fast, but lower quality.

      Available in iOS 2.0 and later.

    • kAudioUnitSampleRateConverterComplexity_Normal

      kAudioUnitSampleRateConverterComplexity_Normal

      Normal quality sample rate conversion.

      Available in iOS 2.0 and later.

    • kAudioUnitSampleRateConverterComplexity_Mastering

      kAudioUnitSampleRateConverterComplexity_Mastering

      Mastering quality sample rate conversion. More computationally expensive.

      Available in iOS 2.0 and later.

    Discussion

    The lowest quality of the Mastering algorithm is higher than the highest quality of the Normal algorithm.

  • Render quality settings for audio units.

    Declaration

    Swift

    var kRenderQuality_Max: Int { get } var kRenderQuality_High: Int { get } var kRenderQuality_Medium: Int { get } var kRenderQuality_Low: Int { get } var kRenderQuality_Min: Int { get }

    Objective-C

    enum { kRenderQuality_Max = 0x7F, kRenderQuality_High = 0x60, kRenderQuality_Medium = 0x40, kRenderQuality_Low = 0x20, kRenderQuality_Min = 0 };

    Constants

    • kRenderQuality_Max

      kRenderQuality_Max

      Available in iOS 2.0 and later.

    • kRenderQuality_High

      kRenderQuality_High

      Available in iOS 2.0 and later.

    • kRenderQuality_Medium

      kRenderQuality_Medium

      Available in iOS 2.0 and later.

    • kRenderQuality_Low

      kRenderQuality_Low

      Available in iOS 2.0 and later.

    • kRenderQuality_Min

      kRenderQuality_Min

      Available in iOS 2.0 and later.

    Discussion

    Typically, this property is used to trade-off between CPU usage, latency and the quality of the audio unit's processing/output.

  • Spatialization algorithms for panner audio units.

    Declaration

    Swift

    var kSpatializationAlgorithm_EqualPowerPanning: Int { get } var kSpatializationAlgorithm_SphericalHead: Int { get } var kSpatializationAlgorithm_HRTF: Int { get } var kSpatializationAlgorithm_SoundField: Int { get } var kSpatializationAlgorithm_VectorBasedPanning: Int { get } var kSpatializationAlgorithm_StereoPassThrough: Int { get }

    Objective-C

    enum { kSpatializationAlgorithm_EqualPowerPanning = 0, kSpatializationAlgorithm_SphericalHead = 1, kSpatializationAlgorithm_HRTF = 2, kSpatializationAlgorithm_SoundField = 3, kSpatializationAlgorithm_VectorBasedPanning = 4, kSpatializationAlgorithm_StereoPassThrough = 5 };

    Constants

    • kSpatializationAlgorithm_EqualPowerPanning

      kSpatializationAlgorithm_EqualPowerPanning

      Available in iOS 2.0 and later.

    • kSpatializationAlgorithm_SphericalHead

      kSpatializationAlgorithm_SphericalHead

      Available in iOS 2.0 and later.

    • kSpatializationAlgorithm_HRTF

      kSpatializationAlgorithm_HRTF

      Available in iOS 2.0 and later.

    • kSpatializationAlgorithm_SoundField

      kSpatializationAlgorithm_SoundField

      Available in iOS 2.0 and later.

    • kSpatializationAlgorithm_VectorBasedPanning

      kSpatializationAlgorithm_VectorBasedPanning

      Available in iOS 2.0 and later.

    • kSpatializationAlgorithm_StereoPassThrough

      kSpatializationAlgorithm_StereoPassThrough

      Available in iOS 2.0 and later.

  • Keys that designate units of measure for audio unit parameters.

    Declaration

    Swift

    var kAudioUnitParameterUnit_Generic: Int { get } var kAudioUnitParameterUnit_Indexed: Int { get } var kAudioUnitParameterUnit_Boolean: Int { get } var kAudioUnitParameterUnit_Percent: Int { get } var kAudioUnitParameterUnit_Seconds: Int { get } var kAudioUnitParameterUnit_SampleFrames: Int { get } var kAudioUnitParameterUnit_Phase: Int { get } var kAudioUnitParameterUnit_Rate: Int { get } var kAudioUnitParameterUnit_Hertz: Int { get } var kAudioUnitParameterUnit_Cents: Int { get } var kAudioUnitParameterUnit_RelativeSemiTones: Int { get } var kAudioUnitParameterUnit_MIDINoteNumber: Int { get } var kAudioUnitParameterUnit_MIDIController: Int { get } var kAudioUnitParameterUnit_Decibels: Int { get } var kAudioUnitParameterUnit_LinearGain: Int { get } var kAudioUnitParameterUnit_Degrees: Int { get } var kAudioUnitParameterUnit_EqualPowerCrossfade: Int { get } var kAudioUnitParameterUnit_MixerFaderCurve1: Int { get } var kAudioUnitParameterUnit_Pan: Int { get } var kAudioUnitParameterUnit_Meters: Int { get } var kAudioUnitParameterUnit_AbsoluteCents: Int { get } var kAudioUnitParameterUnit_Octaves: Int { get } var kAudioUnitParameterUnit_BPM: Int { get } var kAudioUnitParameterUnit_Beats: Int { get } var kAudioUnitParameterUnit_Milliseconds: Int { get } var kAudioUnitParameterUnit_Ratio: Int { get } var kAudioUnitParameterUnit_CustomUnit: Int { get }

    Objective-C

    enum { kAudioUnitParameterUnit_Generic = 0, kAudioUnitParameterUnit_Indexed = 1, kAudioUnitParameterUnit_Boolean = 2, kAudioUnitParameterUnit_Percent = 3, kAudioUnitParameterUnit_Seconds = 4, kAudioUnitParameterUnit_SampleFrames = 5, kAudioUnitParameterUnit_Phase = 6, kAudioUnitParameterUnit_Rate = 7, kAudioUnitParameterUnit_Hertz = 8, kAudioUnitParameterUnit_Cents = 9, kAudioUnitParameterUnit_RelativeSemiTones = 10, kAudioUnitParameterUnit_MIDINoteNumber = 11, kAudioUnitParameterUnit_MIDIController = 12, kAudioUnitParameterUnit_Decibels = 13, kAudioUnitParameterUnit_LinearGain = 14, kAudioUnitParameterUnit_Degrees = 15, kAudioUnitParameterUnit_EqualPowerCrossfade = 16, kAudioUnitParameterUnit_MixerFaderCurve1 = 17, kAudioUnitParameterUnit_Pan = 18, kAudioUnitParameterUnit_Meters = 19, kAudioUnitParameterUnit_AbsoluteCents = 20, kAudioUnitParameterUnit_Octaves = 21, kAudioUnitParameterUnit_BPM = 22, kAudioUnitParameterUnit_Beats = 23, kAudioUnitParameterUnit_Milliseconds = 24, kAudioUnitParameterUnit_Ratio = 25, kAudioUnitParameterUnit_CustomUnit = 26 }; typedef UInt32 AudioUnitParameterUnit;

    Constants

    • kAudioUnitParameterUnit_Generic

      kAudioUnitParameterUnit_Generic

      A generic unit of measure.

      Expected but not required to range between 0.0 and 1.0.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Indexed

      kAudioUnitParameterUnit_Indexed

      An indexed unit of measure.

      Indicates a particular menu item in a list of menu items, typically using whole-number values starting at 1.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Boolean

      kAudioUnitParameterUnit_Boolean

      A Boolean-like unit of measure.

      A value of 0.0 means FALSE and a nonzero value means TRUE.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Percent

      kAudioUnitParameterUnit_Percent

      A percentage unit of measure.

      Most audio unit parameters of this type range from 0 (for 0%) through 100 (for 100%). Some range from from –50 to +50.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Seconds

      kAudioUnitParameterUnit_Seconds

      A whole-seconds unit of measure, indicating either absolute or relative time.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_SampleFrames

      kAudioUnitParameterUnit_SampleFrames

      A sample-frame-count unit of measure.

      The duration of a sample frame, for fixed frame-rate audio formats, is equal to 1.0/kAudioUnitProperty_SampleRate seconds.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Phase

      kAudioUnitParameterUnit_Phase

      An angular degree unit of measure.

      Typical range is –180 through +180 and is intended to represent the phase difference between two signals. See also the kAudioUnitParameterUnit_Degrees property.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Rate

      kAudioUnitParameterUnit_Rate

      A multiplication factor unit of measure.

      A multiplication factor, most often used for playback speed. A value of 2.0, for example, means twice as fast. May also be used for other purposes where a multiplication factor is appropriate.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Hertz

      kAudioUnitParameterUnit_Hertz

      A hertz unit of measure.

      Absolute frequency or pitch in cycles per second.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Cents

      kAudioUnitParameterUnit_Cents

      A logarithmic unit of measure for a musical interval between two notes.

      Relative musical pitch in cents, where 1,200 cents are equal to one octave. 100 cents are equal to one semitone. See also the kAudioUnitParameterUnit_AbsoluteCents property.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_RelativeSemiTones

      kAudioUnitParameterUnit_RelativeSemiTones

      A relative unit of measure for a musical interval between two notes.

      One octave has 12 semitones equal in size. Each semitone is equivalent to 100 cents. This parameter unit is useful for coarse tuning or detuning.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_MIDINoteNumber

      kAudioUnitParameterUnit_MIDINoteNumber

      A whole-number unit of measure corresponding to audio frequency.

      Absolute pitch as defined in the MIDI specification. A standard piano keyboard ranges from MIDI note number 21 (for the A0 note) to 108 (for the C8 note), with MIDI note 60 corresponding to middle C (C4). The frequency for a given MIDI note number may depend on a tuning table.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_MIDIController

      kAudioUnitParameterUnit_MIDIController

      A whole-number unit of measure corresponding to standard MIDI control numbers.

      Range is from 0 through 127.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Decibels

      kAudioUnitParameterUnit_Decibels

      A logarithmic unit of measure representing the ratio between two audio levels.

      Typically used as a relative measure of audio gain.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_LinearGain

      kAudioUnitParameterUnit_LinearGain

      A linear unit of measure representing the difference between two audio levels.

      Typically used as a relative measure of audio gain.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Degrees

      kAudioUnitParameterUnit_Degrees

      An angular degree unit of measure.

      Typical range is from –180° through +180° and is intended as a general representation of geometric position, such as for audio sources in a three-dimensional coordinate system. See also the kAudioUnitParameterUnit_Phase property.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_EqualPowerCrossfade

      kAudioUnitParameterUnit_EqualPowerCrossfade

      An audio power unit of measure.

      Recommended range is from 0 through 100, representing a crossfade mix of two sources according to sqrt (x) and sqrt (1.0 - x).

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_MixerFaderCurve1

      kAudioUnitParameterUnit_MixerFaderCurve1

      An audio power unit of measure.

      Recommended range is from 0.0 through 1.0. Use pow (x, 3.0) to simulate a reasonable linear mixer channel fader response.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Pan

      kAudioUnitParameterUnit_Pan

      An audio position unit of measure.

      For standard left-to-right audio panning.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Meters

      kAudioUnitParameterUnit_Meters

      A distance unit of measure, corresponding to meters.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_AbsoluteCents

      kAudioUnitParameterUnit_AbsoluteCents

      An absolute unit of measure for the musical pitch of a note.

      Absolute musical pitch in cents. 1,200 cents are equal to one octave. If f is a frequency in hertz, then absoluteCents = 1200 * log2 (f/440) + 6900. See also the kAudioUnitParameterUnit_Cents property.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Octaves

      kAudioUnitParameterUnit_Octaves

      A relative unit of measure for the musical interval between two notes.

      Octaves in relative pitch, where a value of 1 is equal to an interval of 1200 cents.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_BPM

      kAudioUnitParameterUnit_BPM

      A whole-number unit of measure for musical tempo, representing beats per minute.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Beats

      kAudioUnitParameterUnit_Beats

      A time unit of measure in musical beats.

      1.0 beats at 120 BPM (beats per minute) equals a duration of 1/2 second.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Milliseconds

      kAudioUnitParameterUnit_Milliseconds

      A time unit of measure representing milliseconds.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_Ratio

      kAudioUnitParameterUnit_Ratio

      A unitless ratio unit of measure.

      Useful for representing an amount of compression or expansion, for example.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterUnit_CustomUnit

      kAudioUnitParameterUnit_CustomUnit

      A custom unit of measure.

      Available in iOS 2.0 and later.

    Discussion

    The system does not restrict the range for audio unit values. The limits described here are recommendations for providing value ranges that are natural according to the intent of each parameter.

    Every unit of measure for an audio unit parameter is implemented as a floating point value. Some audio unit parameters are used in an indexed fashion, such as to support picking from a popup menu (see the kAudioUnitParameterUnit_Indexed property), or in a Boolean fashion, such as for a checkbox (see the kAudioUnitParameterUnit_Boolean property). Such parameters have floating point values as well.

  • Value options for audio unit parameters.

    Declaration

    Swift

    var kAudioUnitParameterFlag_CFNameRelease: Int { get } var kAudioUnitParameterFlag_PlotHistory: Int { get } var kAudioUnitParameterFlag_MeterReadOnly: Int { get } var kAudioUnitParameterFlag_DisplayMask: Int { get } var kAudioUnitParameterFlag_DisplaySquareRoot: Int { get } var kAudioUnitParameterFlag_DisplaySquared: Int { get } var kAudioUnitParameterFlag_DisplayCubed: Int { get } var kAudioUnitParameterFlag_DisplayCubeRoot: Int { get } var kAudioUnitParameterFlag_DisplayExponential: Int { get } var kAudioUnitParameterFlag_HasClump: Int { get } var kAudioUnitParameterFlag_ValuesHaveStrings: Int { get } var kAudioUnitParameterFlag_DisplayLogarithmic: Int { get } var kAudioUnitParameterFlag_IsHighResolution: Int { get } var kAudioUnitParameterFlag_NonRealTime: Int { get } var kAudioUnitParameterFlag_CanRamp: Int { get } var kAudioUnitParameterFlag_ExpertMode: Int { get } var kAudioUnitParameterFlag_HasCFNameString: Int { get } var kAudioUnitParameterFlag_IsGlobalMeta: Int { get } var kAudioUnitParameterFlag_IsElementMeta: Int { get } var kAudioUnitParameterFlag_IsReadable: Int { get } var kAudioUnitParameterFlag_IsWritable: Int { get }

    Objective-C

    enum { kAudioUnitParameterFlag_CFNameRelease = (1L << 4), kAudioUnitParameterFlag_PlotHistory = (1L << 14), kAudioUnitParameterFlag_MeterReadOnly = (1L << 15), kAudioUnitParameterFlag_DisplayMask = (7L << 16) | (1L << 22), kAudioUnitParameterFlag_DisplaySquareRoot = (1L << 16), kAudioUnitParameterFlag_DisplaySquared = (2L << 16), kAudioUnitParameterFlag_DisplayCubed = (3L << 16), kAudioUnitParameterFlag_DisplayCubeRoot = (4L << 16), kAudioUnitParameterFlag_DisplayExponential = (5L << 16), kAudioUnitParameterFlag_HasClump = (1L << 20), kAudioUnitParameterFlag_ValuesHaveStrings = (1L << 21), kAudioUnitParameterFlag_DisplayLogarithmic = (1L << 22), kAudioUnitParameterFlag_IsHighResolution = (1L << 23), kAudioUnitParameterFlag_NonRealTime = (1L << 24), kAudioUnitParameterFlag_CanRamp = (1L << 25), kAudioUnitParameterFlag_ExpertMode = (1L << 26), kAudioUnitParameterFlag_HasCFNameString = (1L << 27), kAudioUnitParameterFlag_IsGlobalMeta = (1L << 28), kAudioUnitParameterFlag_IsElementMeta = (1L << 29), kAudioUnitParameterFlag_IsReadable = (1L << 30), kAudioUnitParameterFlag_IsWritable = (1L << 31) };

    Constants

    • kAudioUnitParameterFlag_CFNameRelease

      kAudioUnitParameterFlag_CFNameRelease

      If an audio unit can generate parameter names dynamically, it should set this flag.

      Audio unit hosting applications should check for this flag being set. If it is, the host should release the audio unit parameter name when it is done using it.

      If this flag is not set, the host application can assume that the audio unit will release its parameter names.

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_PlotHistory

      kAudioUnitParameterFlag_PlotHistory

      If set, getting the kAudioUnitProperty_ParameterHistoryInfo property fills out the AudioUnitParameterHistoryInfo struct containing the recommended update rate and history duration.

      Available in iOS 4.3 and later.

    • kAudioUnitParameterFlag_MeterReadOnly

      kAudioUnitParameterFlag_MeterReadOnly

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_DisplayMask

      kAudioUnitParameterFlag_DisplayMask

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_DisplaySquareRoot

      kAudioUnitParameterFlag_DisplaySquareRoot

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_DisplaySquared

      kAudioUnitParameterFlag_DisplaySquared

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_DisplayCubed

      kAudioUnitParameterFlag_DisplayCubed

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_DisplayCubeRoot

      kAudioUnitParameterFlag_DisplayCubeRoot

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_DisplayExponential

      kAudioUnitParameterFlag_DisplayExponential

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_HasClump

      kAudioUnitParameterFlag_HasClump

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_ValuesHaveStrings

      kAudioUnitParameterFlag_ValuesHaveStrings

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_DisplayLogarithmic

      kAudioUnitParameterFlag_DisplayLogarithmic

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_IsHighResolution

      kAudioUnitParameterFlag_IsHighResolution

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_NonRealTime

      kAudioUnitParameterFlag_NonRealTime

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_CanRamp

      kAudioUnitParameterFlag_CanRamp

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_ExpertMode

      kAudioUnitParameterFlag_ExpertMode

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_HasCFNameString

      kAudioUnitParameterFlag_HasCFNameString

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_IsGlobalMeta

      kAudioUnitParameterFlag_IsGlobalMeta

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_IsElementMeta

      kAudioUnitParameterFlag_IsElementMeta

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_IsReadable

      kAudioUnitParameterFlag_IsReadable

      Available in iOS 2.0 and later.

    • kAudioUnitParameterFlag_IsWritable

      kAudioUnitParameterFlag_IsWritable

      Available in iOS 2.0 and later.

    Discussion

    These constants are relevant only in OS X, and not in iOS.

    Audio unit parameter flags, for use in the AudioUnitParameterInfo data structure , serve as a dictionary-like set of information about an audio unit parameter. Parameter flag bit position 19 is reserved.

  • The maximum number of frequency response bin structures for the AudioUnitProperty_FrequencyResponse property.

    Declaration

    Swift

    var kNumberOfResponseFrequencies: Int { get }

    Objective-C

    enum { kNumberOfResponseFrequencies = 1024 };

    Constants

    • kNumberOfResponseFrequencies

      kNumberOfResponseFrequencies

      The maximum number of frequency response bin structures for the AudioUnitProperty_FrequencyResponse property.

      Available in iOS 2.1 and later.

    Discussion

    An array of AudioUnitFrequencyResponseBin are passed in to kAudioUnitProperty_FrequencyResponse with the mFrequency field filled in. The array is returned with the mMagnitude fields filled in. If fewer than kNumberOfResponseFrequencies are needed, then the first unused bin should be marked with a negative frequency.

  • Keys for audio unit kAudioUnitProperty_ClassInfo property dictionaries.

    Declaration

    Swift

    var kAUPresetVersionKey: String { get } var kAUPresetTypeKey: String { get } var kAUPresetSubtypeKey: String { get } var kAUPresetManufacturerKey: String { get } var kAUPresetDataKey: String { get } var kAUPresetNameKey: String { get } var kAUPresetRenderQualityKey: String { get } var kAUPresetCPULoadKey: String { get } var kAUPresetElementNameKey: String { get } var kAUPresetExternalFileRefs: String { get } var kAUPresetPartKey: String { get }

    Objective-C

    #define kAUPresetVersionKey "version" #define kAUPresetTypeKey "type" #define kAUPresetSubtypeKey "subtype" #define kAUPresetManufacturerKey "manufacturer" #define kAUPresetDataKey "data" #define kAUPresetNameKey "name" #define kAUPresetRenderQualityKey "render-quality" #define kAUPresetCPULoadKey "cpu-load" #define kAUPresetElementNameKey "element-name" #define kAUPresetExternalFileRefs "file-references" #define kAUPresetPartKey "part"

    Constants

    • kAUPresetVersionKey

      kAUPresetVersionKey

      Available in iOS 2.0 and later.

    • kAUPresetTypeKey

      kAUPresetTypeKey

      Available in iOS 2.0 and later.

    • kAUPresetSubtypeKey

      kAUPresetSubtypeKey

      Available in iOS 2.0 and later.

    • kAUPresetManufacturerKey

      kAUPresetManufacturerKey

      Available in iOS 2.0 and later.

    • kAUPresetDataKey

      kAUPresetDataKey

      Available in iOS 2.0 and later.

    • kAUPresetNameKey

      kAUPresetNameKey

      Available in iOS 2.0 and later.

    • kAUPresetRenderQualityKey

      kAUPresetRenderQualityKey

      Available in iOS 2.0 and later.

    • kAUPresetCPULoadKey

      kAUPresetCPULoadKey

      Available in iOS 2.0 and later.

    • kAUPresetElementNameKey

      kAUPresetElementNameKey

      Available in iOS 2.0 and later.

    • kAUPresetExternalFileRefs

      kAUPresetExternalFileRefs

      Available in iOS 2.0 and later.

    • kAUPresetPartKey

      kAUPresetPartKey

      If present, distinguishes a global preset that is set on the global scope from a part-based preset that is set on the part scope. The value of this key is defined by the audio unit it applies to.

      Available in iOS 2.0 and later.

    Discussion

    Use these audio unit preset keys as follows:

    • static const CFStringRef kMyVersionString = CFSTR (kAUPresetVersionKey);
  • Reserved for system use.

    Declaration

    Swift

    var kAudioUnitClumpID_System: Int { get }

    Objective-C

    enum { kAudioUnitClumpID_System = 0 };

    Constants

    • kAudioUnitClumpID_System

      kAudioUnitClumpID_System

      Reserved for system use. Use clump ID values other than 0.

      Available in iOS 2.0 and later.