Contents

scheduleBuffer(_:at:options:completionCallbackType:completionHandler:)

Schedules the playing samples from an audio buffer with the playback options you specify.

Declaration

func scheduleBuffer(_ buffer: AVAudioPCMBuffer, at when: AVAudioTime?, options: AVAudioPlayerNodeBufferOptions = [], completionCallbackType callbackType: AVAudioPlayerNodeCompletionCallbackType, completionHandler: (@Sendable (AVAudioPlayerNodeCompletionCallbackType) -> Void)? = nil)
func scheduleBuffer(_ buffer: AVAudioPCMBuffer, at when: AVAudioTime?, options: AVAudioPlayerNodeBufferOptions = [], completionCallbackType callbackType: AVAudioPlayerNodeCompletionCallbackType) async -> AVAudioPlayerNodeCompletionCallbackType

Parameters

  • buffer:

    The buffer to play.

  • when:

    The time the buffer plays.

  • options:

    The playback options that control buffer scheduling.

  • 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