Audio unit output.
More...
#import <AEAudioUnitOutput.h>
Inherits NSObject.
Audio unit output.
Renders audio to the system output via an audio unit.
- (instancetype _Nullable) initWithRenderer: |
|
(AERenderer *_Nonnull) |
renderer |
|
Initialize with a renderer.
- Parameters
-
renderer | Renderer to use to drive processing |
- (BOOL) setup: |
|
(NSError *__autoreleasing _Nullable *_Nullable) |
error |
|
Setup (optional)
You may call this method prior to start: to set up the rendering resources. Once this is called, the audioUnit property will yield a valid audio unit instance. If you do not use this method, it will be called automatically the first time start: is called.
- Parameters
-
error | If an error occured and this is not nil, it will be set to the error on output |
- Returns
- YES on success, NO on failure
- (BOOL) start: |
|
(NSError *__autoreleasing _Nullable *_Nullable) |
error |
|
Start the audio unit.
- Parameters
-
error | If an error occured and this is not nil, it will be set to the error on output |
- Returns
- YES on success, NO on failure
- (AudioUnit _Nullable) AEAudioUnitOutputGetAudioUnit |
|
(__unsafe_unretained AEAudioUnitOutput *_Nonnull) |
output |
|
Get access to audio unit.
Available for realtime thread usage
- Parameters
-
output | The output instance |
- Returns
- The audio unit
Get the output latency.
This function returns the hardware output latency, in seconds. If you have disabled latency compensation, and timing is important in your app, then you should factor this value into your timing calculations.
- Parameters
-
output | The output instance |
- Returns
- The current output latency
The renderer. You may change this at any time; assignment is thread-safe.
- (AudioUnit _Nullable) audioUnit |
|
readnonatomicassign |
The sample rate at which to run, or zero to track the hardware sample rate.
- (double) currentSampleRate |
|
readnonatomicassign |
Whether unit is currently active.
- (int) numberOfOutputChannels |
|
readnonatomicassign |
The current number of output channels.
- (BOOL) latencyCompensation |
|
readwritenonatomicassign |
Whether to automatically perform latency compensation (default YES)
The input module.
This is a module that can be used to pull audio input from this unit, instead of using AEAudioUnitInputModule. Use this particularly if you intend to implement an Inter-App Audio or Audiobus effect node.
On the Mac, this returns an instance that uses its own audio unit.
On iOS, this returns an instance that uses the output's audio unit. Note that starting and stopping the returned module will cause the output's audio unit to be uninitialized, reconfigured then reinitialized, temporarily interrupting audio rendering.
The documentation for this class was generated from the following file: