One Logo Pool Ball
AVFoundation · IOS API REFERENCE

AVSampleBufferAudioRenderer.Receiver

class · iOS 27.0+ · SDK 27.1

class Receiver

Members (5)

method · iOS 27.0+

enqueueImmediately

TypeScript
enqueueImmediately(sampleBuffer: _CoreMedia_CMReadySampleBuffer<_CoreMedia_CMSampleBuffer_DynamicContent>): AVSampleBufferAudioRenderer_Receiver_EnqueueResult
Swift declaration
func enqueueImmediately(_ sampleBuffer: CMReadySampleBuffer<CMSampleBuffer.DynamicContent>) -> AVSampleBufferAudioRenderer.Receiver.EnqueueResult

Enqueues a sample buffer in order to render its contents, without waiting for the renderer to become ready for more media data. - Parameter sampleBuffer: The sample buffer to enqueue. - Returns: The result of the enqueue operation.

get · iOS 27.0+

renderingEventsAfterFinishedEnqueuing

TypeScript
get renderingEventsAfterFinishedEnqueuing(): (SDKHandle) & (SDKHandle)
Swift declaration
var renderingEventsAfterFinishedEnqueuing: some Sendable & AsyncSequence<AVSampleBufferAudioRenderer.Receiver.RenderingEvent, Never> { get }

A sequence of events that may occur when rendering after enqueuing samples has finished. After enqueuing samples, iterate over this sequence to discover any issues that may occur while the renderer continues rendering. Break out of the iteration when done monitoring rendering events.

method · iOS 27.0+

flush

TypeScript
flushFromSourceTime(sourceTime: _CoreMedia_CMTime): Promise<boolean>
Swift declaration
nonisolated(nonsending) func flush(fromSourceTime sourceTime: CMTime) async -> Bool

Flushes enqueued sample buffers with presentation time stamps later than or equal to the specified time. This method suspends until the flush is completed. - Parameter sourceTime: The source time for the flush to take effect. - Returns: If the flush was successful, this method returns `true`. Otherwise it returns `false`. This method can be used to replace media data scheduled to be rendered in the future, without interrupting playback. One example of this is when the data that has already been enqueued is from a sequence of two songs and the second song is swapped for a new song. In this case, this method would be called with the time stamp of the first sample buffer from the second song. After this method resumes returning `true`, media data may again be enqueued with timestamps at the specified time. If this method returns `false`, the flush did not succeed and the set of enqueued sample buffers remains unchanged. A flush can fail because the source time was too close to (or earlier than) the current time or because the current configuration of the receiver does not support flushing at a particular time. In these cases, the caller can choose to flush all enqueued media data by invoking the `flush()` method.

method · iOS 27.0+

flush

TypeScript
flush(): void
Swift declaration
func flush()

Instructs the receiver to discard pending enqueued sample buffers. Additional sample buffers can be appended after `flush()`.

method · iOS 27.0+

enqueue

TypeScript
enqueue(sampleBuffer: _CoreMedia_CMReadySampleBuffer<_CoreMedia_CMSampleBuffer_DynamicContent>): Promise<AVSampleBufferAudioRenderer_Receiver_EnqueueResult>
Swift declaration
nonisolated(nonsending) func enqueue(_ sampleBuffer: CMReadySampleBuffer<CMSampleBuffer.DynamicContent>) async throws -> AVSampleBufferAudioRenderer.Receiver.EnqueueResult

Suspends until the receiver is ready for more media data, then enqueues a sample buffer in order to render its contents. - Parameter sampleBuffer: The sample buffer to enqueue. - Returns: The result of the enqueue operation. - Throws: `CancellationError` if the Task was cancelled.

Skipped declarations

No declarations were skipped in this snapshot.

All AVFoundation types →