Audio Unit Properties Reference
| Framework | AudioUnit/AudioUnit.h |
| Declared in | AudioUnitProperties.h |
Overview
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
This chapter describes the function-like macros declared in the AudioUnitProperties.h header file. You can use these macros to work with an audio unit parameter’s display types—one of the attributes specified by the flags field in the AudioUnitParameterInfo data structure.
AudioUnitDisplayTypeIsCubed
Determines if the display type is cubed.
#define AudioUnitDisplayTypeIsCubed (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplayCubed )
Parameters
- flags
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAudioUnitDisplayTypeIsCubeRoot
Determines if the display type is cube root.
#define AudioUnitDisplayTypeIsCubeRoot (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplayCubeRoot )
Parameters
- flags
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAudioUnitDisplayTypeIsExponential
Determines if the display type is exponential.
#define AudioUnitDisplayTypeIsExponential (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplayExponential )
Parameters
- flags
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAudioUnitDisplayTypeIsLogarithmic
Determines if the display type is logarithmic.
#define AudioUnitDisplayTypeIsLogarithmic (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplayLogarithmic )
Parameters
- flags
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAudioUnitDisplayTypeIsSquared
Determines if the display type is squared.
#define AudioUnitDisplayTypeIsSquared (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplaySquared )
Parameters
- flags
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAudioUnitDisplayTypeIsSquareRoot
Determines if the display type is square root.
#define AudioUnitDisplayTypeIsSquareRoot (flags) ( GetAudioUnitParameterDisplayType (flags) == kAudioUnitParameterFlag_DisplaySquareRoot )
Parameters
- flags
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hGetAudioUnitParameterDisplayType
Gets the display type for a parameter.
#define GetAudioUnitParameterDisplayType (flags) ( (flags) & kAudioUnitParameterFlag_DisplayMask )
Parameters
- flags
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hSetAudioUnitParameterDisplayType
Sets the display type.
#define SetAudioUnitParameterDisplayType (flags, displayType) ( ((flags) & ~kAudioUnitParameterFlag_DisplayMask) | (displayType) )
Parameters
- flags
- displayType
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hCallbacks by Task
Timing and Transport Callback Functions
Audio unit host applications can implement these callback functions to provide information to audio units.
Callbacks
HostCallback_GetBeatAndTempo
When called by the system, provides beat and tempo information to an audio unit from a host application.
typedef OSStatus (*HostCallback_GetBeatAndTempo) ( void *inHostUserData, Float64 *outCurrentBeat, Float64 *outCurrentTempo );
If you named your callback function MyHostCallback_GetBeatAndTempo, you would declare it like this:
OSStatus MyHostCallback_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.
Availability
- Available in iOS 5.0 and later.
Declared In
AudioUnitProperties.hHostCallback_GetMusicalTimeLocation
When called by the system, provides musical timing information to an audio unit from a host application.
typedef OSStatus (*HostCallback_GetMusicalTimeLocation) ( void *inHostUserData, UInt32 *outDeltaSampleOffsetToNextBeat, Float32 *outTimeSig_Numerator, UInt32 *outTimeSig_Denominator, Float64 *outCurrentMeasureDownBeat );
If you named your callback function MyHostCallback_GetMusicalTimeLocation, you would declare it like this:
OSStatus MyHostCallback_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
Availability
- Available in iOS 5.0 and later.
Declared In
AudioUnitProperties.hHostCallback_GetTransportState
When called by the system, provides audio transport state and timeline information to an audio unit from a host application.
typedef OSStatus (*HostCallback_GetTransportState) ( void *inHostUserData, Boolean *outIsPlaying, Boolean *outTransportStateChanged, Float64 *outCurrentSampleInTimeLine, Boolean *outIsCycling, Float64 *outCycleStartBeat, Float64 *outCycleEndBeat );
If you named your callback function MyHostCallback_GetTransportState, you would declare it like this:
OSStatus MyHostCallback_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,
TRUEif audio is playing, orFALSEotherwise.- outTransportStateChanged
On output,
TRUEif the transport state changed since the last time the callback was invoked, orFALSEotherwise.- outCurrentSampleInTimeLine
On output, the sample number, indexed from zero from the beginning of the timeline.
- outIsCycling
On output,
TRUEif cycling, orFALSEotherwise.- outCycleStartBeat
- outCycleEndBeat
Availability
- Available in iOS 5.0 and later.
Declared In
AudioUnitProperties.hData Types
AUChannelInfo
The audio input and output channel capabilities for an audio unit.
typedef struct AUChannelInfo {
SInt16 inChannels;
SInt16 outChannels;
} AUChannelInfo;
Fields
inChannelsThe number of input channels.
outChannelsThe number of output channels.
Discussion
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAUDependentParameter
An audio unit parameter whose value can change in response to a change in its parent metaparameter.
typedef struct AUDependentParameter {
AudioUnitScope mScope;
AudioUnitParameterID mParameterID;
} AUDependentParameter;
Fields
mScopemParameterID
Availability
- Available in iOS 6.0 and later.
Declared In
AudioUnitProperties.hAudioOutputUnitStartAtTimeParams
A timestamp for scheduled starting of an I/O audio unit.
typedef struct AudioOutputUnitStartAtTimeParams {
AudioTimeStamp mTimestamp;
UInt32 mFlags;
} AudioOutputUnitStartAtTimeParams;
Fields
mTimestampmFlags
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAudioUnitConnection
An audio unit source-to-destination connection specification.
typedef struct AudioUnitConnection {
AudioUnit sourceAudioUnit;
UInt32 sourceOutputNumber;
UInt32 destInputNumber;
} AudioUnitConnection;
Fields
sourceAudioUnitThe audio unit that is serves as the source in the connection.
sourceOutputNumberThe source audio unit’s output element to be used in the connection.
destInputNumberThe destination audio unit’s input element to be used in the connection.
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAudioUnitExternalBuffer
Allows an audio unit host application to tell an audio unit to use a specified buffer for its input callback.
typedef struct AudioUnitExternalBuffer {
Byte *buffer;
UInt32 size;
} AudioUnitExternalBuffer;
Fields
buffersize
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAudioUnitFrequencyResponseBin
An audio unit’s audio level at a particular frequency.
typedef struct AudioUnitFrequencyResponseBin {
Float64 mFrequency;
Float64 mMagnitude;
} AudioUnitFrequencyResponseBin;
Fields
mFrequencymMagnitude
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.
Declared In
AudioUnitProperties.hAudioUnitMeterClipping
Audio clipping that has occurred in a mixer unit.
typedef struct AudioUnitMeterClipping {
Float32 peakValueSinceLastCall;
Boolean sawInfinity;
Boolean sawNotANumber;
} AudioUnitMeterClipping;
Fields
peakValueSinceLastCallThe maximum value seen on the channel since the last time the property was retrieved.
sawInfinityTRUEif there was an infinite value on this channel since the last time the property was retrieved.sawNotANumberTRUEif 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.
Declared In
AudioUnitProperties.hAudioUnitParameterUnit
The unit-of-measure for an audio unit parameter.
typedef UInt32 AudioUnitParameterUnit;
Discussion
The various units of measure for audio unit parameters are described in “Audio Unit Parameter Units of Measure.”
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAudioUnitParameterInfo
typedef struct AudioUnitParameterInfo {
char name[52];
CFStringRef unitName;
UInt32 clumpID;
CFStringRef cfNameString;
AudioUnitParameterUnit unit;
AudioUnitParameterValue minValue;
AudioUnitParameterValue maxValue;
AudioUnitParameterValue defaultValue;
UInt32 flags;
} AudioUnitParameterInfo;
Fields
nameMust be set to
0.unitNameIf
kAudioUnitParameterUnit_CustomUnitis set, this field must contain a validCFStringobject. Only valid ifkAudioUnitParameterUnit_CustomUnitis set.clumpIDOnly valid if
kAudioUnitParameterFlag_HasClumpis set.cfNameStringOnly valid if
kAudioUnitParameterFlag_HasCFNameStringis set.unitIf the
unitfield contains a value not in theAudioUnitParameterUnitenumeration, then assume the unit type iskAudioUnitParameterUnit_Generic.minValuemaxValuedefaultValueflagsDue 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 beCFStringobjects, 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.
Declared In
AudioUnitProperties.hAudioUnitParameterHistoryInfo
The suggested update rate and history duration for parameters which have the kAudioUnitParameterFlag_PlotHistory flag set.
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.
Declared In
AudioUnitProperties.hAUInputSamplesInOutputCallbackStruct
The callback function and custom data for providing input-to-output sample mapping for an audio unit.
typedef struct AUInputSamplesInOutputCallbackStruct {
AUInputSamplesInOutputCallback inputToOutputCallback;
void *userData;
} AUInputSamplesInOutputCallbackStruct;
Fields
inputToOutputCallbackThe callback function that provides input-to-output sample mapping for an audio unit.
userDataCustom data for input-to-output sample mapping for an audio unit.
Availability
- Available in iOS 6.0 and later.
Declared In
AudioUnitProperties.hAUPreset
Used to set factory presets for an audio unit.
typedef struct AUPreset {
SInt32 presetNumber;
CFStringRef presetName;
} AUPreset;
Fields
presetNumberIf less than
0, then the preset is a user preset. If greater than or equal to0, then this field is used to select a factory preset.presetNameIf a factory preset, the name of the specified factory preset.
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hAURenderCallbackStruct
Used for registering an input callback function with an audio unit.
typedef struct AURenderCallbackStruct {
AURenderCallback inputProc;
void *inputProcRefCon;
} AURenderCallbackStruct;
Fields
inputProcinputProcRefCon
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hHostCallbackInfo
The time- and transport-related callback functions for an audio unit.
typedef struct HostCallbackInfo {
void *hostUserData;
HostCallback_GetBeatAndTempo beatAndTempoProc;
HostCallback_GetMusicalTimeLocation musicalTimeLocationProc;
HostCallback_GetTransportState transportStateProc;
} HostCallbackInfo;
Fields
hostUserDataCustom data specified by your application. May be
NULL.beatAndTempoProcYour callback function that provides beat and tempo information to an audio unit. May be
NULL.musicalTimeLocationProcYour callback function that provides musical timeline information to an audio unit. May be
NULL.transportStateProcYour 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.
Declared In
AudioUnitProperties.hMixerDistanceParams
typedef struct MixerDistanceParams {
Float32 mReferenceDistance;
Float32 mMaxDistance;
Float32 mMaxAttenuation; // in decibels
} MixerDistanceParams;
Fields
mReferenceDistancemMaxDistancemMaxAttenuation
Availability
- Available in iOS 2.0 and later.
Declared In
AudioUnitProperties.hScheduledAudioFileRegion
struct ScheduledAudioFileRegion {
AudioTimeStamp mTimeStamp;
ScheduledAudioFileRegionCompletionProc mCompletionProc;
void *mCompletionProcUserData;
struct OpaqueAudioFileID *mAudioFile;
UInt32 mLoopCount;
SInt64 mStartFrame;
UInt32 mFramesToPlay;
};
Fields
mTimeStampmCompletionProcmay be
NULLmCompletionProcUserDatamAudioFileMust be a valid and already-open audio file object (of type
AudioFileID), as declared inAudioToolbox/AudioFile.h.mLoopCount0= do not loopmStartFrameThe frame offset into the file.
mFramesToPlayThe number of frames to play.
Constants
Audio Unit Scopes
Programmatic roles and contexts for audio unit properties.
enum {
kAudioUnitScope_Global = 0,
kAudioUnitScope_Input = 1,
kAudioUnitScope_Output = 2,
kAudioUnitScope_Group = 3,
kAudioUnitScope_Part = 4,
kAudioUnitScope_Note = 5
};
Constants
kAudioUnitScope_GlobalThe context for audio unit characteristics that apply to the audio unit as a whole.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitScope_InputThe context for audio data coming into an audio unit.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitScope_OutputThe context for audio data leaving an audio unit.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitScope_GroupIn OS X, a context specific to the control scope of audio unit parameters.
Available in iOS 5.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitScope_PartIn 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.
Declared in
AudioUnitProperties.h.kAudioUnitScope_NoteIn 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
MusicDeviceStartNotefunction inAudioUnit/MusicDevice.h).Available in iOS 5.0 and later.
Declared in
AudioUnitProperties.h.
Discussion
Each audio unit scope is a discrete programmatic context. Apple reserves scope identifiers from 0 through 1024.
Generic Audio Unit Properties
Properties that apply to any audio unit.
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_OfflineRender = 37,
kAudioUnitProperty_DependentParameters = 45,
kAudioUnitProperty_InputSamplesInOutput = 49,
kAudioUnitProperty_FrequencyResponse = 52
};
Constants
kAudioUnitProperty_ClassInfoDescribes the state of an audio unit.
A read/write
CFDictionaryRefobject 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
AudioUnitSetPropertyfunction, you own the reference to the dictionary and are responsible for later releasing it by calling theCFReleasefunction.When obtaining a class information dictionary from an audio unit with the
AudioUnitGetPropertyfunction, you also own the reference to the dictionary and are responsible for later releasing it by calling theCFReleasefunction.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_MakeConnectionA write-only
AudioUnitConnectiondata structure valid on the audio unit input scope.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_SampleRateA read/write
Float64value valid on the audio unit input and output scopes.The audio sample rate for a specified scope.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_ParameterListA list of read-only
AudioUnitParameterIDvalues valid on any audio unit scope.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_ParameterInfoA read-only
AudioUnitParameterInfodata 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_ParameterIDNameproperty.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_StreamFormatThe audio data stream format for an audio unit input or output element (also called bus).
A read/write
AudioStreamBasicDescriptiondata structure valid on the audio unit input and output scopes.An
AudioStreamBasicDescriptionstruct does not specify channel layout or purpose. To specify a channel layout, use thekAudioUnitProperty_AudioChannelLayoutproperty.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_ElementCountA read/write
UInt32value 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_LatencyA read-only
Float64value 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_SupportedNumChannelsA read-only array of
AUChannelInfostructures valid on the audio unit global scope.The size of the array indicates the number of
AUChannelInfostructures 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
AUChannelInfostructure 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
inChannelsfield means that an audio unit does not have any audio input buses.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_MaximumFramesPerSliceSpecifies the maximum number of sample frames an audio unit is prepared to supply on one invocation of its
AudioUnitRenderfunction.A read/write
UInt32value 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)
Default
1024
23
Screen sleep
4096
93
Low latency
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.
Important: If audio input is not running and the device screen sleeps, and you have not set a value of 4096 on each non-I/O audio unit being used by your app, audio stops. Always set this property as described here.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_AudioChannelLayoutA read/write
AudioChannelLayoutdata 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:
Implemented and set
Implemented but not set
Unimplemented
Requesting the value of this property when it is implemented but not set results in a
kAudioUnitErr_PropertyNotInUseerror.Use the
kAudioUnitProperty_AudioChannelLayoutproperty whenever channel layout is relevant.For related information, refer to the descriptions for the
ScheduledAudioFileRegionandAudioOutputUnitStartAtTimeParamsdata structures.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_TailTimeA read-only
Float64value 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_BypassEffectA read/write
UInt32value, 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_LastRenderErrorA read-only
OSStatusvalue valid on the audio unit global scope.This property is set if a call to the
AudioUnitRenderfunction returns an error. To be notified of errors, register a callback function as a property listener using theAudioUnitAddPropertyListenerfunction.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_SetRenderCallbackA write-only
AURenderCallbackStructdata 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
AudioUnitSetPropertyfunction from your application to assign the callback, you specify the input bus that the callback applies to. See theAURenderCallbackcallback function.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_FactoryPresetsSo-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_PresentPresetproperty.A read-only
CFArrayRefarray ofAUPresetstructures.When obtaining a factory preset array from an audio unit with the
AudioUnitGetPropertyfunction, you own the reference to the array and are responsible for later releasing it by calling theCFReleasefunction.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_RenderQualityA read/write
UInt32value 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_InPlaceProcessingA read/write
UInt32value, 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_ElementNameThe name of the specified element.
A read/write
CFStringRefobject valid on any audio unit scope.When assigning an element name string to an audio unit with the
AudioUnitSetPropertyfunction, you own the reference to the name and are responsible for later releasing it by calling theCFReleasefunction.When obtaining an element name string from an audio unit with the
AudioUnitGetPropertyfunction, you also own the reference to the name and are responsible for later releasing it by calling theCFReleasefunction.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_SupportedChannelLayoutTagsA read only array on
AudioChannelLayoutTagstructures, 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_PresentPresetThe active factory preset for an audio unit.
A read/write
AUPresetdata structure valid on the audio unit global scope, The presetName field in the struct is of typeCFStringRefand follows Core Foundation memory semantics.When setting the active factory preset on an audio unit with the
AudioUnitSetPropertyfunction, you own the reference to the preset name and are responsible for later releasing it by calling theCFReleasefunction.When obtaining the active factory preset from an audio unit with the
AudioUnitGetPropertyfunction, you also own the reference to the preset name and are responsible for later releasing it by calling theCFReleasefunction.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_ShouldAllocateBufferA read/write
UInt32value 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_ParameterHistoryInfoFor parameters that have the
kAudioUnitParameterFlag_PlotHistoryflag set, getting this property fills out theAudioUnitParameterHistoryInfostruct containing the recommended update rate and history duration.Available in iOS 4.3 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_FrequencyResponseAvailable in iOS 2.1 through iOS 2.2.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_CPULoadA read-only
Float64value 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_ParameterValueStringsAn 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
CFArrayRefobject whose elements areCFStringRefobjects, valid on any audio unit scope.When obtaining a parameter string array from an audio unit with the
AudioUnitGetPropertyfunction, you own the reference to the array and are responsible for later releasing it by calling theCFReleasefunction.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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_HostCallbacksA 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_OfflineRenderAvailable in iOS 6.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_DependentParametersA 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.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_InputSamplesInOutputA 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.
Declared in
AudioUnitProperties.h.
Discussion
The integer range for the set of generic audio unit property identifiers is 0 through 999.
I/O Audio Unit Properties
Properties for Apple I/O audio units (sometimes called output units).
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_CurrentDeviceA read/write audio device ID object, of type
AudioDeviceID, valid on the audio unit global scope.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioOutputUnitProperty_IsRunningIndicates whether an audio unit is running (
TRUE) or not (FALSE).Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioOutputUnitProperty_ChannelMapMaps 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.
Declared in
AudioUnitProperties.h.kAudioOutputUnitProperty_EnableIOSpecifies 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
UInt32value valid on the input and output scopes.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioOutputUnitProperty_StartTimeA write-only
AudioOutputUnitStartAtTimeParamsdata 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 forinRequestedStartTimeIsInput.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioOutputUnitProperty_SetInputCallbackA read/write
AURenderCallbackStructdata 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 theAudioUnitRenderfunction.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioOutputUnitProperty_HasIOA UInt32 value. Scope: { scope output, element 0 = output } { scope input, element 1 = input }. Value is
1if input or output is enabled on the specified element. SeekAudioOutputUnitProperty_EnableIO.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioOutputUnitProperty_StartTimestampsAtZeroA read/write
UInt32value valid on the audio unit global scope.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
Voice-Processing I/O Audio Unit Properties
Properties that apply to the Apple voice-processing I/O audio unit.
enum {
kAUVoiceIOProperty_BypassVoiceProcessing = 2100,
kAUVoiceIOProperty_VoiceProcessingEnableAGC = 2101,
kAUVoiceIOProperty_MuteOutput = 2104,
};
Constants
kAUVoiceIOProperty_BypassVoiceProcessingIndicates 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
UInt32valid on the global audio unit scope.Available in iOS 3.0 and later.
Declared in
AudioUnitProperties.h.kAUVoiceIOProperty_VoiceProcessingEnableAGCIndicates 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
UInt32valid on the global audio unit scope.Available in iOS 3.0 and later.
Declared in
AudioUnitProperties.h.kAUVoiceIOProperty_MuteOutputMutes 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
UInt32valid on the global audio unit scope.Available in iOS 4.0 and later.
Declared in
AudioUnitProperties.h.
Mixer Audio Unit Properties
Properties for Apple mixer audio units.
enum {
// For general mixers
kAudioUnitProperty_MeteringMode = 3007,
// For the matrix mixer
kAudioUnitProperty_MatrixLevels = 3006,
kAudioUnitProperty_MatrixDimensions = 3009,
kAudioUnitProperty_MeterClipping = 3011
};
Constants
kAudioUnitProperty_MeteringModeSpecifies whether metering is enabled or disabled for a particular scope-element combination.
A read/write
UInt32value valid on the input and output scopes.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_MatrixLevelsDescribes 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_MatrixDimensionsproperty.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
Float32values. 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 atvolumes[1][2]Output volumes are stored in the last row: first output channel at
volumes [2][0]; second output channel atvolumes[2][1]Cross-point volumes are stored at their expected locations(
volumes[0][1], etc)
A read-only two-dimensional array of
Float32values valid on the audio unit global scope.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_MatrixDimensionsIndicates the total number of channels for input and output of a given matrix mixer.
A read-only
2 * UInt32value valid on the audio unit global scope.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_MeterClippingIndicates audio clipping that has occurred since this property was last accessed.
A read-only
AudioUnitMeterClippingdata structure valid on the audio unit global scope.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
3D Mixer Audio Unit Properties
Properties for the Apple 3D Mixer audio unit.
enum {
kAudioUnitProperty_3DMixerDistanceParams = 3010,
kAudioUnitProperty_3DMixerAttenuationCurve = 3013,
kAudioUnitProperty_SpatializationAlgorithm = 3000,
kAudioUnitProperty_DopplerShift = 3002,
kAudioUnitProperty_3DMixerRenderingFlags = 3003,
kAudioUnitProperty_3DMixerDistanceAtten = 3004,
kAudioUnitProperty_ReverbPreset = 3012
};
Constants
kAudioUnitProperty_3DMixerDistanceParamsAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_3DMixerAttenuationCurveAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_SpatializationAlgorithmAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_DopplerShiftAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_3DMixerRenderingFlagsAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_3DMixerDistanceAttenAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitProperty_ReverbPresetAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
3D Mixer Attenuation Curves
Audio level attenuation curves to use with the Apple 3D Mixer audio unit.
enum {
k3DMixerAttenuationCurve_Power = 0,
k3DMixerAttenuationCurve_Exponential = 1,
k3DMixerAttenuationCurve_Inverse = 2,
k3DMixerAttenuationCurve_Linear = 3
};
Constants
k3DMixerAttenuationCurve_PowerAn equal-power-based attenuation curve.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.k3DMixerAttenuationCurve_ExponentialAn exponential attenuation curve.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.k3DMixerAttenuationCurve_InverseAn inverse attenuation curve.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.k3DMixerAttenuationCurve_LinearA linear attenuation curve.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
3D Mixer Rendering Flags
Rendering options for the Apple 3D Mixer audio unit.
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_InterAuralDelayAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.k3DMixerRenderingFlags_DopplerShiftAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.k3DMixerRenderingFlags_DistanceAttenuationAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.k3DMixerRenderingFlags_DistanceFilterAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.k3DMixerRenderingFlags_DistanceDiffusionAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.k3DMixerRenderingFlags_LinearDistanceAttenuationAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.k3DMixerRenderingFlags_ConstantReverbBlendAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
Converter Audio Unit Properties
Properties for the Apple AUConverter audio unit.
enum {
kAudioUnitProperty_SampleRateConverterComplexity = 3014
};
Constants
kAudioUnitProperty_SampleRateConverterComplexityThe quality of sample-rate conversion for the audio unit to perform. A
UInt32value valid on the audio unit global scope.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
Audio Unit Sample Rate Converter Complexity
Quality levels for the audio sample-rate conversion algorithm.
enum {
kAudioUnitSampleRateConverterComplexity_Linear = 'line',
kAudioUnitSampleRateConverterComplexity_Normal = 'norm',
kAudioUnitSampleRateConverterComplexity_Mastering = 'bats'
};
Constants
kAudioUnitSampleRateConverterComplexity_LinearBasic sample rate conversion using linear interpolation. Fast, but lower quality.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitSampleRateConverterComplexity_NormalNormal quality sample rate conversion.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitSampleRateConverterComplexity_MasteringMastering quality sample rate conversion. More computationally expensive.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
Discussion
The lowest quality of the Mastering algorithm is higher than the highest quality of the Normal algorithm.
RenderQuality
Render quality settings for audio units.
enum {
kRenderQuality_Max = 0x7F,
kRenderQuality_High = 0x60,
kRenderQuality_Medium = 0x40,
kRenderQuality_Low = 0x20,
kRenderQuality_Min = 0
};
Constants
kRenderQuality_MaxAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kRenderQuality_HighAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kRenderQuality_MediumAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kRenderQuality_LowAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kRenderQuality_MinAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
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
Spatialization algorithms for panner audio units.
enum {
kSpatializationAlgorithm_EqualPowerPanning = 0,
kSpatializationAlgorithm_SphericalHead = 1,
kSpatializationAlgorithm_HRTF = 2,
kSpatializationAlgorithm_SoundField = 3,
kSpatializationAlgorithm_VectorBasedPanning = 4,
kSpatializationAlgorithm_StereoPassThrough = 5
};
Constants
kSpatializationAlgorithm_EqualPowerPanningAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kSpatializationAlgorithm_SphericalHeadAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kSpatializationAlgorithm_HRTFAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kSpatializationAlgorithm_SoundFieldAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kSpatializationAlgorithm_VectorBasedPanningAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kSpatializationAlgorithm_StereoPassThroughAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
Audio Unit Parameter Units of Measure
Keys that designate units of measure for audio unit parameters.
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_GenericA generic unit of measure.
Expected but not required to range between 0.0 and 1.0.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_IndexedAn 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.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_BooleanA Boolean-like unit of measure.
A value of 0.0 means
FALSEand a nonzero value meansTRUE.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_PercentA 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.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_SecondsA whole-seconds unit of measure, indicating either absolute or relative time.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_SampleFramesA sample-frame-count unit of measure.
The duration of a sample frame, for fixed frame-rate audio formats, is equal to 1.0/
kAudioUnitProperty_SampleRateseconds.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_PhaseAn 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_Degreesproperty.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_RateA 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.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_HertzA hertz unit of measure.
Absolute frequency or pitch in cycles per second.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_CentsA 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_AbsoluteCentsproperty.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_RelativeSemiTonesA 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.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_MIDINoteNumberA 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.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_MIDIControllerA whole-number unit of measure corresponding to standard MIDI control numbers.
Range is from 0 through 127.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_DecibelsA 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.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_LinearGainA 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.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_DegreesAn 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_Phaseproperty.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_EqualPowerCrossfadeAn audio power unit of measure.
Recommended range is from 0 through 100, representing a crossfade mix of two sources according to
sqrt (x)andsqrt (1.0 - x).Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_MixerFaderCurve1An 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.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_PanAn audio position unit of measure.
For standard left-to-right audio panning.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_MetersA distance unit of measure, corresponding to meters.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_AbsoluteCentsAn 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
fis a frequency in hertz, thenabsoluteCents = 1200 * log2 (f/440) + 6900. See also thekAudioUnitParameterUnit_Centsproperty.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_OctavesA 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
1200cents.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_BPMA whole-number unit of measure for musical tempo, representing beats per minute.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_BeatsA 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.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_MillisecondsA time unit of measure representing milliseconds.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_RatioA unitless ratio unit of measure.
Useful for representing an amount of compression or expansion, for example.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterUnit_CustomUnitA custom unit of measure.
Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
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.
Audio Unit Parameter Flags
Value options for audio unit parameters.
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_CFNameReleaseIf 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.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_PlotHistoryIf set, getting the
kAudioUnitProperty_ParameterHistoryInfoproperty fills out theAudioUnitParameterHistoryInfostruct containing the recommended update rate and history duration.Available in iOS 4.3 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_MeterReadOnlyAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_DisplayMaskAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_DisplaySquareRootAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_DisplaySquaredAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_DisplayCubedAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_DisplayCubeRootAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_DisplayExponentialAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_HasClumpAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_ValuesHaveStringsAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_DisplayLogarithmicAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_IsHighResolutionAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_NonRealTimeAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_CanRampAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_ExpertModeAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_HasCFNameStringAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_IsGlobalMetaAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_IsElementMetaAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_IsReadableAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAudioUnitParameterFlag_IsWritableAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
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.
Frequency Response Constants
The maximum number of frequency response bin structures for the AudioUnitProperty_FrequencyResponse property.
enum {
kNumberOfResponseFrequencies = 1024
};
Constants
kNumberOfResponseFrequenciesThe maximum number of frequency response bin structures for the
AudioUnitProperty_FrequencyResponseproperty.Available in iOS 2.1 and later.
Declared in
AudioUnitProperties.h.
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.
Audio Unit Preset Keys
Keys for audio unit kAudioUnitProperty_ClassInfo property dictionaries.
#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
kAUPresetVersionKeyAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAUPresetTypeKeyAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAUPresetSubtypeKeyAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAUPresetManufacturerKeyAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAUPresetDataKeyAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAUPresetNameKeyAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAUPresetRenderQualityKeyAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAUPresetCPULoadKeyAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAUPresetElementNameKeyAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAUPresetExternalFileRefsAvailable in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.kAUPresetPartKeyIf 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.
Declared in
AudioUnitProperties.h.
Discussion
Use these audio unit preset keys as follows:
static const CFStringRef kMyVersionString = CFSTR (kAUPresetVersionKey); |
Reserved Audio Unit Clump Identifier
Reserved for system use.
enum {
kAudioUnitClumpID_System = 0
};
Constants
kAudioUnitClumpID_SystemReserved for system use. Use clump ID values other than
0.Available in iOS 2.0 and later.
Declared in
AudioUnitProperties.h.
Platform Considerations
In OS X, you should not use this constant. It is reserved for system use. This constant does not apply in iOS because iOS does not support audio unit views.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-12-13)