Interface AVCaptureAudioDataOutputSampleBufferDelegate


  • public interface AVCaptureAudioDataOutputSampleBufferDelegate
    [@protocol] AVCaptureAudioDataOutputSampleBufferDelegate Defines an interface for delegates of AVCaptureAudioDataOutput to receive captured audio sample buffers.
    • Method Detail

      • captureOutputDidOutputSampleBufferFromConnection

        default void captureOutputDidOutputSampleBufferFromConnection​(AVCaptureOutput output,
                                                                      CMSampleBufferRef sampleBuffer,
                                                                      AVCaptureConnection connection)
        captureOutput:didOutputSampleBuffer:fromConnection: Called whenever an AVCaptureAudioDataOutput instance outputs a new audio sample buffer. Delegates receive this message whenever the output captures and outputs new audio samples, decoding or re-encoding as specified by the audioSettings property. Delegates can use the provided sample buffer in conjunction with other APIs for further processing. This method will be called on the dispatch queue specified by the output's sampleBufferCallbackQueue property. This method is called periodically, so it must be efficient to prevent capture performance problems, including dropped audio samples. Clients that need to reference the CMSampleBuffer object outside of the scope of this method must CFRetain it and then CFRelease it when they are finished with it.
        Parameters:
        output - The AVCaptureAudioDataOutput instance that output the samples.
        sampleBuffer - A CMSampleBuffer object containing the audio samples and additional information about them, such as their format and presentation time.
        connection - The AVCaptureConnection from which the audio was received.