init(renderBlock:)
Creates an audio source node with a block that supplies audio data.
Declaration
init(renderBlock block: @escaping AVAudioSourceNodeRenderBlock)Parameters
- block:
The block to supply audio data to the output.
Discussion
When connecting the audio source node to another node, the system uses the connection format to set the audio format for the output bus.
Depending on the audio engine’s operating mode, call the block on real-time or nonreal-time threads. When rendering to a device, avoid making blocking calls within the block.
The system sets the node’s output format using the audio format for the render block. When reconnecting the node with a different output format, the audio format for the block changes.