kAudioUnitProperty_MaximumFramesPerSlice
Specifies the maximum number of sample frames an audio unit is prepared to supply on one invocation of its Audiounitrender(_:_:_:_:_:_:) function.
Declaration
var kAudioUnitProperty_MaximumFramesPerSlice: AudioUnitPropertyID { get }Discussion
A read/write UInt32 value valid on the audio unit global scope.
The default value of this property is 1,024, corresponding to about 23 ms at a 44.1 kHz sample rate. This default value is sufficient when a host app is using the default hardware buffer size and the device screen is not sleeping. When the device screen sleeps, the system saves power by reducing the frequency at which it requests sample frames. There is a corresponding increase in the number of sample frames requested of an audio unit, per render call.
The following table provides some common slice sizes:
Frame count | Milliseconds at 44.1 kHz (approximate) | |
|---|---|---|
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.
See Also
Properties
kAudioUnitProperty_ElementCountkAudioUnitProperty_SupportedNumChannelskAudioUnitProperty_AudioChannelLayoutkAudioUnitProperty_AudioUnitMIDIProtocolkAudioUnitProperty_AUHostIdentifierkAudioUnitProperty_BypassEffectkAudioUnitProperty_ClassInfokAudioUnitProperty_ClassInfoFromDocumentkAudioUnitProperty_CocoaUIkAudioUnitProperty_ContextNamekAudioUnitProperty_CPULoadkAudioUnitProperty_DependentParameterskAudioUnitProperty_ElementNamekAudioUnitProperty_FactoryPresetskAudioUnitProperty_FastDispatch