Important: The information in this document is obsolete and should not be used for new development.
This chapter describes the functions, structures, and constants used throughout the Audio Unit framework. The section “Reference” describes the constants, data types, and functions that are relevant to audio unit development.
In Core Audio, audio units serve a number of purposes. Audio
units are used to generate, process, receive, or otherwise manipulate
streams of audio. They are building blocks that may be used singly
or connected together to form an audio signal graph, or AUGraph
.
The audio unit framework provides a set of services that developers can take advantage of in their own applications by using audio units. The framework also provides services for those who want to develop their own audio units.
Audio units are defined as processing units. Their input can come from a variety of sources (for example, encoded data, other audio units, or none); their output is generally a buffer of audio data.
Apple ships a set of AudioUnit components, as well as defining the interface for the AudioUnit component.
In Java, these services are available in the com.apple.audio.units
package.
In the Macintosh system architecture, audio units are simply
components, and like all components are identified based on their
four-character code type, subType and ID field. The Component Manager
provides a set of APIs for querying the available components on
the system. You can use the FindNextComponent()
call
to find out what audio units are installed on the system. Instances
are created by means of the OpenAComponent()
call
and released by the CloseComponent()
call.
For more information on the Component Manager, consult More Macintosh Toolbox.
The audio unit API presents the basic audio unit interface, as well as the constants that define the audio unit type, and the generic sub-types of an audio unit.
The specific ID of an audio unit represents the specific functionality
of the audio unit itself. For example, the DLSMusicDevice is an
audio unit that is able to use both Downloadable Sounds (DLS) and
SoundFont 2 (SF2) files as sample data for sample-based synthesis.
Its type is ‘aumu
’––
an audio unit music device. Its sub-type is ‘dls
’
–– a DLS music device (note the space at the end).
For more specific information about components, refer to Inside Macintosh: More Macintosh Toolbox, Chapter 6, Component Manager.
The basic audio unit states are closed, open, and initialized, which correspond to these calls:
OpenAComponent()
CloseAComponent()
AudioUnitInitialize()
AudioUnitUninitalize()
No significant resource allocations are expected to occur
when the audio unit component is first opened with OpenAComponent()
. AudioUnitInitialize()
is
called after optional configuration has occured. This is where the
audio unit allocates and is prepared to render.
AudioUnitReset()
may be called
on any initialized audio unit. The AudioUnitReset()
call
clears any buffers, resets filter memory, and stops any playing
notes (for example, in a MusicDevice software synthesizer). It places
the audio unit back to its initialized state.
Audio units have sources and destinations. An audio unit can be just a source unit, such as software synthesizers, which are presented as a type of audio unit defined as a MusicDevice.
An audio unit can also be just a destination that is attached to a hardware output device.
Some audio units contain both input and output audio data. DSP processors, such as reverbs, filters, and mixers are examples, as are format converters, such as 16-bit integer to floating-point converters, interleavers-deinterleavers, and sample rate converters.
Properties represent a general and extensible mechanism for
passing information to and from audio units. Information is communicated
via a void*
data parameter
and a data byte-size parameter. The type of information is identified
by an AudioUnitPropertyID
.
Information is addressed to a particular section of an audio
unit with AudioUnitScope
and AudioUnitElement
. AudioUnitScope
includes
the following constants:
kAudioUnitScope_Global
kAudioUnitScope_Input
kAudioUnitScope_Output
kAudioUnitScope_Group
AudioUnitElement
is
a zero-based index of a particular input, output, or group and
is typically ignored for global scope. AudioUnitPropertyID
s
are defined in Constants
.
Parameters are values that can change over time, and are generally time-sensitive and can be scheduled. Parameters could include such things as volume or panning of a particular output on the mixer audio unit, for instance.
Audio unit I/O Management relies on a “pull” I/O model, which specifies through its properties the number and format of its inputs and outputs. Each input/output is a set of audio buffers corresponding to audio channels.
Data can be supplied to an audio unit through one of two mechanisms:
Connecting an audio unit output to another audio
unit that will provide input using kAudioUnitProperty_MakeConnection
.
Audio data is automatically routed to the input with no required
user intervention.
Registering a client callback using kAudioUnitProperty_SetInputCallback
where
the client can provide audio source data to an audio unit through
the supplied callback.
The AUGraph API provides a higher-level connection service, freeing the client from calling the audio unit directly.
As mentioned, audio units use a “pull” I/O model, with
each unit specifying through its properties the number and format
of its inputs and ouputs. Each output is in itself a set of audio
buffers corresponding to audio channels. Connections between units
are also managed via properties. Data is requested from an audio
unit through its AudioUnitRender
function
being called by one of its destinations, or the AURenderCallback
being called.
Key points about AudioUnitRender()
arguments:
The AudioTimeStamp
specifies
the start time of the buffer to be rendered, synchronizing the
hosttime of the machine with the sample time of the audio to lock
it with other realtime events such as MIDI.
The AudioBufferList
argument
passes in and receives back a set of buffers of audio data. The
client may pass in a list or let the AudioUnit provide it.
A client can request notifications of the rendering activity
of an audio unit by installing a callback using kAudioUnitProperty_RenderNotification
.
The client’s callback will then be called by the audio unit, both
before and after any call to the unit’s render slice function.
The ioActionFlags
parameter
provides the unit with instructions on how to handle the buffer supplied:
kAudioUnitRenderAction_Accumulate
––
The unit should sum its output into the given buffer, rather than
replace it. This action is only valid for formats that support
easy stream mixing like linear PCM. In addition, a buffer will always
be supplied.
kAudioUnitRenderAction_UseProvidedBuffer
––
This flag indicates that the rendered audio must be placed in the
buffer pointed the ioData
argument.
In this case, ioData
must
point to a valid piece of allocated memory. If this flag is not
set, the mData member of ioData
may
possibly be changed upon return, pointing to a different buffer
(owned by the audio unit ).
If the ioData
member
is NULL
, then rendering
may set ioData
to a buffer
list owned by the audio unit. In any case, on return, ioData
points
to the rendered audio data.
The inTimeStamp
parameter
gives the audio unit information about what the time is for the start
of the rendered audio output.
The inOutputBusNumber
parameter
requests that audio be rendered for a particular audio output of
the audio unit. Rendering is performed separately for each of its
outputs. The audio unit is expected to cache its rendered audio
for each output in the case that it is called more than once for
the same output (inOutputBusNumber
is
the same) at the same time (inTimeStamp
is
the same). This solves the “fanout” problem.
Additional information and documentation is available with the Core Audio SDK, available from the Audio Developer webpage:
http://developer.apple.com/audio
This reference section describes the structures, constants, parameters, properties, and typedefs provided in the Audio Unit framework. Many of these are universal among all audio units, while some are specific to Apple-provided units.
The following audio units are provided by Apple. The four-character codes identify each of these units with the Component Manager, allowing for you to find and use them.
kAudioUnitType_Output
= FOUR_CHAR_CODE('auou')
The component type for all output units.
kAudioUnitSubType_HALOutput
= FOUR_CHAR_CODE('ahal')
The component subtype for an output unit that uses a HAL output.
kAudioUnitSubType_DefaultOutput
= FOUR_CHAR_CODE('def ')
The component subtype for an output unit that uses the default output, as selected by the user.
kAudioUnitSubType_SystemOutput
= FOUR_CHAR_CODE('sys ')
The component subtype for an output unit that uses the system output.
kAudioUnitSubType_GenericOutput
= FOUR_CHAR_CODE('genr')
The component subtype for a generic output unit.
kAudioUnitType_MusicDevice
= FOUR_CHAR_CODE('aumu')
The component type for a music device unit.
kAudioUnitSubType_DLSSynth
= FOUR_CHAR_CODE('dls ')
The component subtype for the DLS synth music device unit
kAudioUnitType_MusicEffect
= FOUR_CHAR_CODE('aumf')
The component type for a music effect unit.
kAudioUnitType_FormatConverter
= FOUR_CHAR_CODE('aufc')
The component type for a format converter unit.
kAudioUnitSubType_AUConverter
= FOUR_CHAR_CODE('conv')
The component subtype for an AUConverter format converter unit.
kAudioUnitSubType_Varispeed
= FOUR_CHAR_CODE('vari')
The component subtype for a Varispeed effect unit.
kAudioUnitSubType_Delay
= FOUR_CHAR_CODE('dely')
The component subtype for a delay effect unit.
kAudioUnitSubType_LowPassFilter
= FOUR_CHAR_CODE('lpas')
The component subtype for a low-pass filter effect unit.
kAudioUnitSubType_HighPassFilter
= FOUR_CHAR_CODE('hpas')
The component subtype for a high-pass filter effect unit.
kAudioUnitSubType_BandPassFilter
= FOUR_CHAR_CODE('bpas')
The component subtype for a band-pass filter effect unit.
kAudioUnitSubType_HighShelfFilter
= FOUR_CHAR_CODE('hshf')
The component subtype for a high-shelf filter effect unit.
kAudioUnitSubType_LowShelfFilter
= FOUR_CHAR_CODE('lshf')
The component subtype for a low-shelf filter effect unit.
kAudioUnitSubType_ParametricEQ
= FOUR_CHAR_CODE('pmeq')
The component subtype for a parametric equalizer effect unit.
kAudioUnitSubType_GraphicEQ
= FOUR_CHAR_CODE('greq')
The component subtype for a graphic equalizer effect unit.
kAudioUnitSubType_PeakLimiter
= FOUR_CHAR_CODE('lmtr')
The component subtype for a peak limiter effect unit.
kAudioUnitSubType_DynamicsProcessor
= FOUR_CHAR_CODE('dcmp')
The component subtype for a dynamics processor effect unit.
kAudioUnitSubType_MultiBandCompressor
= FOUR_CHAR_CODE('mcmp')
The component subtype for multi-band compressor effect unit.
kAudioUnitSubType_MatrixReverb
= FOUR_CHAR_CODE('mrev')
The component subtype for a matrix reverb effect unit.
kAudioUnitType_Mixer
= FOUR_CHAR_CODE('aumx')
The component type for a mixer unit.
kAudioUnitSubType_StereoMixer
= FOUR_CHAR_CODE('smxr')
The component subtype for a stereo mixer unit.
kAudioUnitSubType_3DMixer
= FOUR_CHAR_CODE('3dmx')
The component subtype for a three-dimensional mixer unit.
kAudioUnitSubType_MatrixMixer
= FOUR_CHAR_CODE('mxmx')
The component subtype for a matrix mixer unit.
kAudioUnitType_Panner
= FOUR_CHAR_CODE('aupn')
The component type for a panner unit.
kAudioUnitType_OfflineEffect
= FOUR_CHAR_CODE('auol')
The component type fpr an offline effect unit.
kAudioUnitManufacturer_Apple
= FOUR_CHAR_CODE('appl')
The component manufacturer type for all units provided by Apple.
These flags provide you with information on the status of a render within an audio unit.
kAudioUnitRenderAction_PreRender
= (1 << 2)
The audio unit is prepared to render.
kAudioUnitRenderAction_PostRender
= (1 << 3)
The audio unit is finished with the current render.
kAudioUnitRenderAction_OutputIsSilence
= (1 << 4)
The current output of the render is silence.
kAudioOfflineUnitRenderAction_Preflight
= (1 << 5)
The audio unit has not yet rendered.
AudioOfflineUnitRenderAction_Render
= (1 << 6)
The audio unit is prepared to render.
kAudioOfflineUnitRenderAction_Complete
= (1 << 7)
The audio unit has been used to render.
These errors may arrise when rendering audio with an audio unit.
kAudioUnitErr_InvalidProperty = -10879 |
kAudioUnitErr_InvalidParameter = -10878 |
kAudioUnitErr_InvalidElement = -10877 |
kAudioUnitErr_NoConnection = -10876 |
kAudioUnitErr_FailedInitialization = -10875 |
kAudioUnitErr_TooManyFramesToProcess = -10874 |
kAudioUnitErr_IllegalInstrument = -10873 |
kAudioUnitErr_InstrumentTypeNotFound = -10872 |
kAudioUnitErr_InvalidFile = -10871 |
kAudioUnitErr_UnknownFileType = -10870 |
kAudioUnitErr_FileNotSpecified = -10869 |
kAudioUnitErr_FormatNotSupported = -10868 |
kAudioUnitErr_Uninitialized = -10867 |
kAudioUnitErr_InvalidScope = -10866 |
kAudioUnitErr_PropertyNotWritable = -10865 |
kAudioUnitErr_InvalidPropertyValue = -10851 |
kAudioUnitErr_PropertyNotInUse = -10850 |
kAudioUnitErr_Initialized = -10849 |
kAudioUnitErr_InvalidOfflineRender = -10848 |
kAudioUnitErr_Unauthorized = -10847 kAudioUnitErr_CannotDoInCurrentContext = -10863 |
These values specify what type of parameter event is occuring.
kParameterEvent_Immediate = 1 |
kParameterEvent_Ramped = 2 |
These selectors determine the state of an audio unit.
kAudioUnitInitializeSelect = 0x0001, |
kAudioUnitUninitializeSelect = 0x0002, |
kAudioUnitGetPropertyInfoSelect = 0x0003, |
kAudioUnitGetPropertySelect = 0x0004, |
kAudioUnitSetPropertySelect = 0x0005, |
kAudioUnitAddPropertyListenerSelect = 0x000A, |
kAudioUnitRemovePropertyListenerSelect = 0x000B, |
kAudioUnitAddRenderNotifySelect = 0x000F, |
kAudioUnitRemoveRenderNotifySelect = 0x0010, |
kAudioUnitGetParameterSelect = 0x0006, |
kAudioUnitSetParameterSelect = 0x0007, |
kAudioUnitScheduleParametersSelect = 0x0011, |
kAudioUnitRenderSelect = 0x000E, |
kAudioUnitResetSelect = 0x0009 |
These properties can be queried of any audio unit instance.
kAudioUnitProperty_ClassInfo = 0 |
kAudioUnitProperty_MakeConnection = 1 |
kAudioUnitProperty_SampleRate = 2 |
kAudioUnitProperty_ParameterList = 3 |
kAudioUnitProperty_ParameterInfo = 4 |
kAudioUnitProperty_FastDispatch = 5 |
kAudioUnitProperty_CPULoad = 6 |
kAudioUnitProperty_StreamFormat = 8 |
kAudioUnitProperty_SRCAlgorithm = 9 |
kAudioUnitProperty_ReverbRoomType = 10 |
kAudioUnitProperty_BusCount = 11 |
kAudioUnitProperty_ElementCount = kAudioUnitProperty_BusCount, |
kAudioUnitProperty_Latency = 12 |
kAudioUnitProperty_SupportedNumChannels = 13 |
kAudioUnitProperty_MaximumFramesPerSlice = 14 |
kAudioUnitProperty_SetExternalBuffer = 15 |
kAudioUnitProperty_ParameterValueStrings = 16 |
kAudioUnitProperty_MIDIControlMapping = 17 |
kAudioUnitProperty_GetUIComponentList = 18 |
kAudioUnitProperty_AudioChannelLayout = 19 |
kAudioUnitProperty_TailTime = 20 |
kAudioUnitProperty_BypassEffect = 21 |
kAudioUnitProperty_LastRenderError = 22 |
kAudioUnitProperty_SetRenderCallback = 23 |
kAudioUnitProperty_FactoryPresets = 24 |
kAudioUnitProperty_ContextName = 25 |
kAudioUnitProperty_RenderQuality = 26 |
kAudioUnitProperty_HostCallbacks = 27 |
kAudioUnitProperty_CurrentPreset = 28 |
kAudioUnitProperty_InPlaceProcessing = 29 |
kAudioUnitProperty_ElementName = 30 |
kAudioUnitProperty_CocoaUI = 31 |
kAudioUnitProperty_SupportedChannelLayoutTags = 32 |
kAudioUnitProperty_ParameterValueName = 33 |
kAudioUnitProperty_ParameterIDName = 34 |
kAudioUnitProperty_ParameterClumpName = 35 |
kAudioUnitProperty_PresentPreset = 36 |
ProperkAudioUnitProperty_UsesInternalReverb = 1005 |
These properties can be queried of any music device audio unit instance.
kMusicDeviceProperty_InstrumentCount = 1000 |
kMusicDeviceProperty_InstrumentName = 1001 |
kMusicDeviceProperty_GroupOutputBus = 1002 |
kMusicDeviceProperty_SoundBankFSSpec = 1003 |
kMusicDeviceProperty_InstrumentNumber = 1004 |
kMusicDeviceProperty_UsesInternalReverb = kAudioUnitProperty_UsesInternalReverb |
kMusicDeviceProperty_MIDIXMLNames = 1006 |
kMusicDeviceProperty_BankName = 1007 |
kMusicDeviceProperty_SoundBankData = 1008 |
kMusicDeviceProperty_PartGroup = 1010 |
kMusicDeviceProperty_StreamFromDisk = 1010 |
These properties can be queried of any output audio unit instance.
kAudioOutputUnitProperty_CurrentDevice = 2000 |
kAudioOutputUnitProperty_IsRunning = 2001 |
kAudioOutputUnitProperty_ChannelMap = 2002 |
kAudioOutputUnitProperty_EnableIO = 2003 |
kAudioOutputUnitProperty_StartTime = 2004 |
kAudioOutputUnitProperty_SetInputCallback = 2005 |
kAudioOutputUnitProperty_HasIO = 2006 |
These properties can be queried of specific audio unit instances.
kAudioUnitProperty_SpatializationAlgorithm = 3000 |
kAudioUnitProperty_SpeakerConfiguration = 3001 |
kAudioUnitProperty_DopplerShift = 3002 |
kAudioUnitProperty_3DMixerRenderingFlags = 3003 |
kAudioUnitProperty_3DMixerDistanceAtten = 3004 |
kAudioUnitProperty_MatrixLevels = 3006 |
kAudioUnitProperty_MeteringMode = 3007 |
kAudioUnitProperty_PannerMode = 3008 |
kAudioUnitProperty_MatrixDimensions = 3009 |
These properties can be queried of offline audio unit instances.
kAudioOfflineUnitProperty_InputSize = 3020 |
kAudioOfflineUnitProperty_OutputSize = 3021 |
kAudioUnitOfflineProperty_StartOffset = 3022 |
kAudioUnitOfflineProperty_PreflightRequirements = 3023 |
kAudioUnitOfflineProperty_PreflightName = 3024 |
These properties can be queried of reverb audio unit instances.
kReverbRoomType_SmallRoom = 0 |
kReverbRoomType_MediumRoom = 1 |
kReverbRoomType_LargeRoom = 2 |
kReverbRoomType_MediumHall = 3 |
kReverbRoomType_LargeHall = 4 |
kReverbRoomType_Plate = 5 |
These properties can be queried of panning audio unit instances.
kSpatializationAlgorithm_EqualPowerPanning = 0 |
kSpatializationAlgorithm_SphericalHead = 1 |
kSpatializationAlgorithm_HRTF = 2 |
kSpatializationAlgorithm_SoundField = 3 |
kSpatializationAlgorithm_VectorBasedPanning = 4 |
kSpatializationAlgorithm_StereoPassThrough = 5 |
These properties can be queried of 3D Mixer audio unit instances.
k3DMixerRenderingFlags_InterAuralDelay = (1L << 0) |
k3DMixerRenderingFlags_DopplerShift = (1L << 1) |
k3DMixerRenderingFlags_DistanceAttenuation = (1L << 2) |
k3DMixerRenderingFlags_DistanceFilter = (1L << 3) |
k3DMixerRenderingFlags_DistanceDiffusion = (1L << 4) |
These properties can be queried of any audio unit instance.
kRenderQuality_Max = 0x7F |
kRenderQuality_High = 0x60 |
kRenderQuality_Medium = 0x40 |
kRenderQuality_Low = 0x20 |
kRenderQuality_Min = 0 |
These properties can be queried of panning audio unit instances.
kPannerMode_Normal = 0 |
kPannerMode_FaderMode = 1 |
These properties can be queried of offline audio unit instances.
kOfflinePreflight_NotRequired = 0 |
kOfflinePreflight_Optional = 1 |
kOfflinePreflight_Required = 2 |
These properties can be queried of any audio unit instance.
kAudioUnitScope_Global = 0 |
kAudioUnitScope_Input = 1 |
kAudioUnitScope_Output = 2 |
kAudioUnitScope_Group = 3 |
kAudioUnitScope_Part = 4 |
These presets are used with AUPreset
.
#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 kAUPresetVSTDataKey "vstdata" |
#define kAUPresetElementNameKey "element-name" |
#define kAUPresetPartKey "part" |
These presets are used with a parameter unit audio unit.
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 |
These flags are used with an audio unit’s parameters.
kAudioUnitParameterFlag_CFNameRelease = (1L << 4) |
kAudioUnitParameterFlag_HasClump = (1L << 20) |
kAudioUnitParameterFlag_HasName = (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) |
These parameters are used with MIDI Controller audio units.
kAUGroupParameterID_Volume = 7 |
kAUGroupParameterID_Sustain = 64 |
kAUGroupParameterID_AllNotesOff = 123 |
kAUGroupParameterID_ModWheel = 1 |
kAUGroupParameterID_PitchBend = 0xE0 |
kAUGroupParameterID_AllSoundOff = 120 |
kAUGroupParameterID_ResetAllControllers = 121 |
kAUGroupParameterID_Pan = 10 |
kAUGroupParameterID_Foot = 4 |
kAUGroupParameterID_ChannelPressure = 0xD0 |
kAUGroupParameterID_KeyPressure = 0xA0 |
kAUGroupParameterID_Expression = 11 |
kAUGroupParameterID_DataEntry = 6 |
kAUGroupParameterID_Volume_LSB = kAUGroupParameterID_Volume + 32 |
kAUGroupParameterID_ModWheel_LSB = kAUGroupParameterID_ModWheel + 32 |
kAUGroupParameterID_Pan_LSB = kAUGroupParameterID_Pan + 32 |
kAUGroupParameterID_Foot_LSB = kAUGroupParameterID_Foot + 32 |
kAUGroupParameterID_Expression_LSB = kAUGroupParameterID_Expression + 32 |
kAUGroupParameterID_DataEntry_LSB = kAUGroupParameterID_DataEntry + 32 |
kAUGroupParameterID_KeyPressure_FirstKey = 256 |
kAUGroupParameterID_KeyPressure_LastKey = 383 |
These parameters are used with the Bandpass Filter Unit.
kBandpassParam_CenterFrequency = 0 |
kBandpassParam_Bandwidth = 1 |
These parameters are used with the AUHipass Unit.
kHighShelfParam_CutOffFrequency = 0 |
kHighShelfParam_Resonance = 1 |
These parameters are used with the AULowpass Unit.
kHighShelfParam_CutOffFrequency = 0 |
kHighShelfParam_Resonance = 1 |
These parameters are used with the AUHighSelfFilter Unit.
kHipassParam_CutoffFrequency = 0 |
kHipassParam_Gain = 1 |
These parameters are used with the AULowSelfFilter Unit.
kHipassParam_CutoffFrequency = 0 |
kHipassParam_Gain = 1 |
These parameters are used with the AUParametricEQ Unit.
kParametricEQParam_CenterFreq = 0 |
kParametricEQParam_Q = 1 |
kParametricEQParam_Gain = 2 |
These parameters are used with the AUMatrixReverb Unit.
kReverbParam_DryWetMix = 0 |
kReverbParam_SmallLargeMix = 1 |
kReverbParam_SmallSize = 2 |
kReverbParam_LargeSize = 3 |
kReverbParam_PreDelay = 4 |
kReverbParam_LargeDelay = 5 |
kReverbParam_SmallDensity = 6 |
kReverbParam_LargeDensity = 7 |
kReverbParam_LargeDelayRange= 8 |
kReverbParam_SmallBrightness= 9 |
kReverbParam_LargeBrightness= 10 |
kReverbParam_SmallDelayRange= 11 |
kReverbParam_ModulationRate = 12 |
kReverbParam_ModulationDepth= 13 |
These parameters are used with the Delay Unit.
kDelayParam_WetDryMix = 0 |
kDelayParam_DelayTime = 1 |
kDelayParam_Feedback = 2 |
kDelayParam_LopassCutoff= 3 |
These parameters are used with the AUPeakLimiter Unit.
kLimiterParam_AttackTime = 0 |
kLimiterParam_DecayTime = 1 |
kLimiterParam_PreGain = 2 |
These parameters are used with the AUDynamicsProcessor Unit.
kDynamicsProcessorParam_Threshold = 0 |
kDynamicsProcessorParam_HeadRoom = 1 |
kDynamicsProcessorParam_ExpansionRatio = 2 |
kDynamicsProcessorParam_ExpansionThreshold = 3 |
kDynamicsProcessorParam_AttackTime = 4 |
kDynamicsProcessorParam_ReleaseTime = 5 |
kDynamicsProcessorParam_MasterGain = 6 |
kDynamicsProcessorParam_CompressionAmount = 1000 |
These parameters are used with the AUMultibandCompressor Unit.
kMultibandCompressorParam_Pregain = 0 |
kMultibandCompressorParam_Postgain = 1 |
kMultibandCompressorParam_Crossover1 = 2 |
kMultibandCompressorParam_Crossover2 = 3 |
kMultibandCompressorParam_Crossover3 = 4 |
kMultibandCompressorParam_Threshold1 = 5 |
kMultibandCompressorParam_Threshold2 = 6 |
kMultibandCompressorParam_Threshold3 = 7 |
kMultibandCompressorParam_Threshold4 = 8 |
kMultibandCompressorParam_Headroom1 = 9 |
kMultibandCompressorParam_Headroom2 = 10 |
kMultibandCompressorParam_Headroom3 = 11 |
kMultibandCompressorParam_Headroom4 = 12 |
kMultibandCompressorParam_AttackTime = 13 |
kMultibandCompressorParam_ReleaseTime = 14 |
kMultibandCompressorParam_EQ1 = 15 |
kMultibandCompressorParam_EQ2 = 16 |
kMultibandCompressorParam_EQ3 = 17 |
kMultibandCompressorParam_EQ4 = 18 |
kMultibandCompressorParam_CompressionAmount1 = 1000 |
kMultibandCompressorParam_CompressionAmount2 = 2000kMultibandCompressorParam_CompressionAmount3 = 3000 |
kMultibandCompressorParam_CompressionAmount4 = 4000 |
These parameters are used with the AUVarispeed Unit.
kVarispeedParam_PlaybackRate = 0 |
kVarispeedParam_PlaybackCents = 1 |
These parameters are used with the 3DMixer Unit.
k3DMixerParam_Azimuth = 0 |
k3DMixerParam_Elevation = 1 |
k3DMixerParam_Distance = 2 |
k3DMixerParam_Gain = 3 |
k3DMixerParam_PlaybackRate = 4 |
k3DMixerParam_PreAveragePower = 1000 |
k3DMixerParam_PrePeakHoldLevel = 2000 |
k3DMixerParam_PostAveragePower = 3000 |
k3DMixerParam_PostPeakHoldLevel = 4000 |
These parameters are used with the StereoMixer Unit.
kStereoMixerParam_Volume = 0 |
kStereoMixerParam_Pan = 1 |
kStereoMixerParam_PreAveragePower = 1000 |
kStereoMixerParam_PrePeakHoldLevel = 2000 |
kStereoMixerParam_PostAveragePower = 3000 |
kStereoMixerParam_PostPeakHoldLevel = 4000 |
These parameters are used with the MatrixMixer Unit.
kMatrixMixerParam_Volume = 0 |
kMatrixMixerParam_Enable = 1 |
kMatrixMixerParam_PreAveragePower = 1000 |
kMatrixMixerParam_PrePeakHoldLevel = 2000 |
kMatrixMixerParam_PostAveragePower = 3000 |
kMatrixMixerParam_PostPeakHoldLevel = 4000 |
kMatrixMixerParam_PreAveragePowerLinear = 5000 |
kMatrixMixerParam_PrePeakHoldLevelLinear = 6000 |
kMatrixMixerParam_PostAveragePowerLinear = 7000 |
kMatrixMixerParam_PostPeakHoldLevelLinear = 8000 |
These parameters are used with Output Units.
kHALOutputParam_Volume = 14 |
These parameters are used with the DLSMusicDevice Unit.
kMusicDeviceParam_Tuning = 0 |
kMusicDeviceParam_Volume = 1 |
kMusicDeviceParam_ReverbVolume = 2 |
These basic types are common within the context of audio units.
typedef UInt32 AudioUnit |
typedef UInt32 AudioUnitPropertyID |
typedef UInt32 AudioUnitParameterID |
typedef UInt32 AudioUnitScope |
typedef UInt32 AudioUnitElement |
typedef UInt32 AUParameterEventType |
typedef UInt32 AudioUnitParameterUnit |
These structures are used throughout the Audio Unit framework when working with properties and parameters.
Used by the Audio Unit Utilities to specify a parameter to be modified.
struct AudioUnitParameter { AudioUnit mAudioUnit; AudioUnitParameterID mParameterID; AudioUnitScope mScope; AudioUnitElement mElement; };
mAudioUnit
The audio unit to be modified.
mParameterID
The parameter to be modified.
mScope
The scope in which the unit is being used.
mElement
The argument to be used with the parameter.
Used by the Audio Unit Utilities to specify a property to be modified.
struct AudioUnitProperty { AudioUnit mAudioUnit; AudioUnitPropertyID mPropertyID; AudioUnitScope mScope; AudioUnitElement mElement; };
mAudioUnit
The audio unit to be modified.
mPropertyID
The parameter to be modified.
mScope
The scope in which the unit is being used.
mElement
The argument to be used with the property.
Used to schedule a change in parameters during a render.
struct AudioUnitParameterEvent { AudioUnitScope scope; AudioUnitElement element; AudioUnitParameterID parameter; AUParameterEventType eventType; union { struct { SInt32 startBufferOffset; UInt32 durationInFrames; Float32 startValue; Float32 endValue; } ramp; struct { UInt32 bufferOffset; Float32 value; } immediate; } eventValues; };
scope
The scope of the event.
element
Additional information about the scope of this event.
parameter
The parameter which is to be modified by the event.
eventType
A constant value; see Parameter Event Types
.
eventValues
A union of the ramp and immediate event values.
ramp
The values if this event is a ramp event.
immediate
The values if this event is an immediate event.
durationInFrames
The length of the event, in frames.
startBufferOffset
The starting point of the event, after the beginning of the render.
startValue
The beginning value for the parameter.
endValue
The audio unit to be modifiedThe ending value of the parameter.
bufferOffset
Where in the current buffer the event should occur.
value
The value the parameter should be changed to.
Connects audio units together.
struct AudioUnitConnection { AudioUnit sourceAudioUnit; UInt32 sourceOutputNumber; UInt32 destInputNumber; }
sourceAudioUnit
The audio unit where data is coming from.
sourceOutputNumber
The output bus on the source audio unit.
destInputNumber
The destination bus on the recieving audio unit.
Encapsulates render callback information.
struct AURenderCallbackStruct { AURenderCallback inputProc; void * inputProcRefCon; }
inputProc
The callback function.
inoutProcRefCon
Any arguments that should be passed to the callback.
Encapsulates information about an external buffer.
struct AudioUnitExternalBuffer { Byte* buffer; UInt32 size; }
buffer
A pointer to a buffer of audio data.
size
The size of the external buffer.
Encapsulates channel information used in a connection.
struct AUChannelInfo { SInt16 inChannels; SInt16 outChannels; }
inChannels
The number of channels on input.
outChannels
The number of channels on output.
Encapsulates channel information used in a connection.
struct AUPreset { SInt32 presetNumber; CFStringRef presetName; }
presetNumber
An arbitrary value for a preset.
presetName
The name for a preset.
Encapsulates callbacks to a host for information.
struct HostCallbackInfo { void* hostUserData; HostCallback_GetBeatAndTempo beatAndTempoProc; HostCallback_GetMusicalTimeLocation musicalTimeLocationProc; }
hostUserData
Additional informaiton needed by the callbacks.
beatAndTempoProc
A callback that determines beat and tempo.
musicTimeLocationProc
A callback that determines the musical time, as numerator and denominator.
Encapsulates the information needed for a Cocoa view.
struct AudioUnitCocoaViewInfo { CFURLRef mCocoaAUViewBundleLocation; CFStringRef mCocoaAUViewClass[1]; }
mCocoaAUViewBundleLocation
The location of the user interface bundle.
mCocoaAUViewClass
The names of the classes that implement the required
protocol for an AUView
.
Encapsulates the information needed when determining a parameter value’s name.
struct AudioUnitParameterValueName { AudioUnitParameterID inParamID; Float32* inValue; CFStringRef outName; }
inParamID
The parameter in question.
inValue
The value being queried upon.
outName
The name corresponding to the value.
Encapsulates the information needed when determining a parameter value’s name.
struct AudioUnitParameterNameInfo { UInt32 inID; SInt32 inDesiredLength; CFStringRef outName; }
inID
The parameter in question.
inDesiredLangth
The desired length of the string.
outName
The name corresponding to the parameter.
Encapsulates an audio units parameter information.
struct AudioUnitParameterInfo { char name[56]; UInt32 clumpID; CFStringRef cfNameString; AudioUnitParameterUnit unit; Float32 minValue; Float32 maxValue; Float32 defaultValue; UInt32 flags; }
name
The name of the parameter.
clumpID
The grouping to which the parameter belongs.
cfNameString
The name of this parameter as a CFString
.
unit
The parameter unit for this parameter.
minValue
The smallest value for the parameter.
maxValue
The largest value for the parameter.
defaultValue
The default value for this parameter.
flags
Any flags that the parameter has attached to it.
Encapsulates MIDI and corresponding audio unit information.
struct AudioUnitMIDIControlMapping { UInt16 midiNRPN; UInt8 midiControl; UInt8 scope; AudioUnitElement element; AudioUnitParameterID parameter; }
midiNRPN
The MIDI note information.
midiControl
The MIDI control information.
scope
The scope of the mapping.
element
Additional scope information.
parameter
The parameter to which the MIDI data is to be applied.
Encapsulates the information needed when a parameter is to take effect at a certain time.
struct AudioOutputUnitStartAtTimeParams { AudioTimeStamp mTimestamp; UInt32 mFlags; }
mTimestamp
The start time for the parameter.
mFlags
The flags for this parameter event.
These functions provide the bulk of the functionality of the Audio Unit framework, and are needed when using or developing an audio unit.
Initializes an audio unit instance.
ComponentResult AudioUnitInitialize( AudioUnit ci )
The audio unit to be initialized.
AUComponent.h
Uninitializes an audio unit instance.
ComponentResult AudioUnitUninitialize( AudioUnit ci )
The audio unit to be uninitialized.
AUComponent.h
Performs the action on a buffer of audio data.
ComponentResult AudioUnitRender( AudioUnit ci, AudioUnitRenderActionFlags* ioActionFlags, const AudioTimeStamp* inTimeStamp, UInt32 inOutputBusNumber, UInt32 inNumberFrames, AudioBufferList* ioData )
The audio unit to be changed.
Flags that provide information on the render; see “Render Action Flags.”
The time the render is begun.
The bus on which the output will be placed.
The number of frames to be rendered.
The audio data, before and after the render.
AUComponent.h
Resets an audio unit.
ComponentResult AudioUnitReset( AudioUnit ci, AudioUnitScope inScope, AudioUnitElement inElement )
The audio unit to be reset.
The scope in which the unit is to be reset.
Additional information about the scope of the audio unit.
AUComponent.h
Returns the size of the data that will be returned when
calling AudioUnitGetProperty
for
the specified property.
ComponentResult AudioUnitGetPropertyInfo( AudioUnit ci, AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, UInt32* outDataSize, Boolean* outWritable )
The audio unit on which the property is to be queried.
The property to be queried upon.
The scope in which the property is applicable.
Further specifies the scope of the property.
The size, in bytes, of the property.
A boolean showing if the property is writable.
AUComponent.h
Returns the size of the data for a specified property.
ComponentResult AudioUnitGetProperty( AudioUnit ci, AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, void* outData, UInt32* ioDataSize )
The audio unit on which the property is to be queried.
The property to be queried upon.
The scope in which the property is applicable.
Further specifies the scope of the property.
A pointer to the data corresponding to the property.
The expected data size and the actual data size returned.
AUComponent.h
Sets a property’s value to the supplied value.
ComponentResult AudioUnitSetProperty( AudioUnit ci, AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, const void* inData, UInt32 inDataSize )
The audio unit on which the property is to be applied.
The property to be modified.
The scope in which the property is applicable.
Further specifies the scope of the property.
A pointer to the data to be applied to the property.
The size of the data being passed in.
AUComponent.h
Monitors an audio unit’s property for changes and issues a callback notification upon the change.
ComponentResult AudioUnitAddPropertyListener( AudioUnit ci, AudioUnitPropertyID inID, AudioUnitPropertyListenerProc inProc, void* inProcRefCon )
The audio unit to be monitored.
The property to be monitored.
The callback to be made when a property is changed.
Additional parameters to be passed to the callback.
AUComponent.h
Removes the specified listener from a property.
ComponentResult AudioUnitRemovePropertyListener( AudioUnit ci, AudioUnitPropertyID inID, AudioUnitPropertyListenerProc inProc )
The audio unit being monitored.
The property being monitored.
The callback to be removed.
AUComponent.h
Specifies a callback to be used before and after an audio unit render occurs.
ComponentResult AudioUnitAddRenderNotify( AudioUnit ci, AURenderCallback inProc, void* inProcRefCon )
The audio unit to bemonitored.
The callback to be issued.
Additional parameters to be passed to the callback.
AUComponent.h
Removes a callback from an audio unit.
ComponentResult AudioUnitRemoveRenderNotify( AudioUnit ci, AURenderCallback inProc, void * inProcRefCon )
The audio unit being monitored.
The callback being issued.
Additional parameters to be passed to the callback.
AUComponent.h
Returns the current value for a parameter.
ComponentResult AudioUnitGetParameter( AudioUnit ci, AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, Float32* outValue )
The audio unit being queried.
The parameter being queried.
The scope in which the parameter works.
Additional information about the scope of the parameter.
The current value of the parameter.
AUComponent.h
Returns the current value for a parameter.
ComponentResult AudioUnitSetParameter( AudioUnit ci, AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, Float32 inValue, UInt32 inBufferOffsetInFrames )
The audio unit to be changed.
The parameter to be changed.
The scope in which the parameter works.
Additional information about the scope of the parameter.
The new value for the parameter.
When in the next render the parameter should be changed.
AUComponent.h
Adds events that change certain parameters.
ComponentResult AudioUnitScheduleParameters( AudioUnit ci, const AudioUnitParameterEvent* inParameterEvent, UInt32 inNumParamEvents )
The audio unit to be changed.
An event or events to be placed.
The number of events being added.
AUComponent.h
These callbacks are provided by you and are used throughout the Audio Unit framework.
A callback set by kAudioUnitProperty_SetRenderCallback
for
performing an audio unit’s render.
typedef CALLBACK_API_C( OSStatus , AURenderCallback )(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
OSStatus AURenderCallback( void * inRefCon; AudioUnitRenderActionFlags * ioActionFlags; const AudioTimeStamp * inTimeStamp; UInt32 inBusNumber; UInt32 inNumberFrames; AudioBufferList* ioData )
Parameters passed to the callback.
Flags for rendering options.
The time that the callback is invoked.
The bun on which data will be supplied.
The number of frames to be rendered.
The audio data to be rendered upon.
AUComponent.h
A callback set by kAudioUnitProperty_SetRenderCallback
for
performing an audio unit’s render.
typedef CALLBACK_API_C( void , AudioUnitPropertyListenerProc )(void *inRefCon, AudioUnit ci, AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement);
void AudioUnitPropertyListenerProc( void * inRefCon, AudioUnit ci, AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement )
Parameters passed to the callback.
The audio unit whose property was modified.
The property that was changed.
The scope of the unit and the property that was changed.
The value that the property was changed to.
AUComponent.h
A callback for returning developer specified parameter values.
typedef CALLBACK_API_C( ComponentResult , AudioUnitGetParameterProc )(void *inComponentStorage, AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, Float32 *outValue);
ComponentResult AudioUnitGetParameterProc( void* inComponentStorage, AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, Float32* outValue )
A pointer to the audio unit.
The parameter being queried.
The scope of the parameter.
Additional information about the scope of the parameter.
The value returned for the parameter.
AUComponent.h
A callback for setting developer specified parameter values.
typedef CALLBACK_API_C( ComponentResult , AudioUnitSetParameterProc )(void *inComponentStorage, AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, Float32 inValue, UInt32 inBufferOffsetInFrames);
ComponentResult AudioUnitSetParameterProc( void* inComponentStorage AudioUnitParameterID inID AudioUnitScope inScope AudioUnitElement inElement Float32 inValue UInt32 inBufferOffsetInFrames )
A pointer to the audio unit.
The parameter to be set.
The scope of the parameter.
Additional information about the scope of the parameter.
The value for the parameter to be set.
The place in the buffer where the parameter change is to happen.
AUComponent.h
A callback for setting developer specified parameter values.
typedef CALLBACK_API_C( ComponentResult , AudioUnitRenderProc )(void *inComponentStorage, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inOutputBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData);
ComponentResult AudioUnitRenderProc( void * inComponentStorage, AudioUnitRenderActionFlags* ioActionFlags, const AudioTimeStamp * inTimeStamp, UInt32 inOutputBusNumber, UInt32 inNumberFrames, AudioBufferList* ioData )
A pointer to the audio unit.
Flags that provide information on the render; see “Render Action Flags.”
The time the render is begun.
The bus on which the output will be placed.
The number of frames to be rendered.
The audio data, before and after the render.
AUComponent.h
A callback for setting developer specified parameter values.
typedef OSStatus (*HostCallback_GetBeatAndTempo) (void * inHostUserData, Float64 *outCurrentBeat, Float64 * outCurrentTempo);
OSStatus HostCallback_GetBeatAndTempo ( void inHostUserData, Float64 * outCurrentBeat, Float64 * outCurrentTempo )
Any arguments needed by the callback.
The beat of the buffered data.
The tempo of the buffered data.
AudioUnitProperties.h
A callback for setting developer specified parameter values.
typedef OSStatus (*HostCallback_GetMusicalTimeLocation) (void *inHostUserData, UInt32 *outDeltaSampleOffsetToNextBeat, Float32 *outTimeSig_Numerator, UInt32 *outTimeSig_Denominator, Float64 *outCurrentMeasureDownBeat);
OSStatus HostCallback_GetMusicalTimeLocation( void* inHostUserData, UInt32* outDeltaSampleOffsetToNextBeat, Float32* outTimeSig_Numerator, UInt32* outTimeSig_Denominator, Float64* outCurrentMeasureDownBeat )
Any arguments needed by the callback.
The average time between beats.
The numerator of the time signature.
The denominator of the time signature.
The beats in the current measure.
AudioUnitProperties.h
A callback for setting developer specified parameter values.
typedef OSStatus (*HostCallback_GetMusicalTimeLocation) (void *inHostUserData, UInt32 *outDeltaSampleOffsetToNextBeat, Float32 *outTimeSig_Numerator, UInt32 *outTimeSig_Denominator, Float64 *outCurrentMeasureDownBeat);
OSStatus HostCallback_GetMusicalTimeLocation( void* inHostUserData, UInt32* outDeltaSampleOffsetToNextBeat, Float32* outTimeSig_Numerator, UInt32* outTimeSig_Denominator, Float64* outCurrentMeasureDownBeat )
Any arguments needed by the callback.
The average time between beats.
The numerator of the time signature.
The denominator of the time signature.
The beats in the current measure.
AudioUnitProperties.h
© 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-10-15)