Contents

scheduleBuffer(_:completionCallbackType:completionHandler:)

Schedules the playing samples from an audio buffer with the callback option you specify.

Declaration

func scheduleBuffer(_ buffer: AVAudioPCMBuffer, completionCallbackType callbackType: AVAudioPlayerNodeCompletionCallbackType, completionHandler: (@Sendable (AVAudioPlayerNodeCompletionCallbackType) -> Void)? = nil)
func scheduleBuffer(_ buffer: AVAudioPCMBuffer, completionCallbackType callbackType: AVAudioPlayerNodeCompletionCallbackType) async -> AVAudioPlayerNodeCompletionCallbackType

Parameters

  • buffer:

    The buffer to play.

  • callbackType:

    The option to specify when the system must call the completion handler.

  • completionHandler:

    The handler the system calls after the player schedules the buffer for playback on the render thread, or the player stops.

See Also

Scheduling Playback