pub type AVAudioIONodeInputBlock = *mut DynBlock<dyn Fn(AVAudioFrameCount) -> *const AudioBufferList>;AVAudioIONode and AVAudioTypes and block2 and objc2-core-audio-types only.Expand description
A block which will be called by AVAudioEngine’s render call when operating in the manual rendering mode, to get input data as needed.
Parameter inNumberOfFrames: The number of frames required to complete the request. You may supply either these many
frames or none.
Returns: An AudioBufferList containing data to be rendered, or null if no data is available. The data in the returned buffer must not be cleared or re-filled until the input block is called again or the rendering has finished. The format of the returned buffer must match the format specified when registering the block.
If you are out of data and return null or less than the requested number of frames, this data will not be used for rendering. The engine will try to render from other active sources in the processing graph, and will inform about the input node’s status in the error returned from its render call.
Note that when the engine is configured to operate in
AVAudioEngineManualRenderingModeRealtime, this block will be called from a realtime
context. Care should be taken not to make any blocking call (e.g. calling libdispatch,
blocking on a mutex, allocating memory etc.) which may cause an overload at the lower layers.
See also Apple’s documentation