Sets the delegate that will accept captured buffers and the dispatch queue on which the delegate will be called.
- iOS 4.0+
- macOS 10.7+
- Mac Catalyst 13.0+
An object conforming to the
AVCaptureprotocol that will receive sample buffers after they are captured.
Audio Data Output Sample Buffer Delegate
You must pass a serial dispatch to guarantee that audio samples will be delivered in order.
The value may not be
NULL, except when setting the
When a new audio sample buffer is captured it is vended to the sample buffer delegate using the
capture delegate method. All delegate methods are called on the specified dispatch queue.
If the queue is blocked when new samples are captured, those samples will be automatically dropped when they become sufficiently late. This allows you to process existing samples on the same queue without having to manage the potential memory usage increases that would otherwise occur when that processing is unable to keep up with the rate of incoming samples.
If you need to minimize the chances of samples being dropped, you should specify a queue on which a sufficiently small amount of processing is being done outside of receiving sample buffers. When migrating extra processing to another queue, you are responsible for ensuring that memory usage does not grow without bound from samples that have not been processed.