Contents

processSampleBuffer(_:with:)

Processes video and audio data as it becomes available during a live broadcast.

Declaration

func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType)

Parameters

  • sampleBuffer:

    A Cmsamplebuffer object containing either audio or video data.

  • sampleBufferType:

    An Rpsamplebuffertype identifying the media type of the recorded sample.

Discussion

This method handles buffers of all sample buffer types throughout each broadcast. If no audio is available — for example, if the microphone isn’t capturing input — ReplayKit provides audio buffers whose samples represent continuous silence.

ReplayKit provides sample buffers sequentially. After invoking this method with a sample buffer, ReplayKit won’t invoke the method again for any sample buffer type until the current invocation returns.

The sample buffer passed to this method is available only until the method returns. You shouldn’t keep a reference to the sample buffer after the method returns.

See Also

Handling Sample Buffer Clips