Contents

scheduleFile(_:at:completionCallbackType:completionHandler:)

Schedules the playing of an entire audio file with a callback option you specify.

Declaration

func scheduleFile(_ file: AVAudioFile, at when: AVAudioTime?, completionCallbackType callbackType: AVAudioPlayerNodeCompletionCallbackType, completionHandler: (@Sendable (AVAudioPlayerNodeCompletionCallbackType) -> Void)? = nil)
func scheduleFile(_ file: AVAudioFile, at when: AVAudioTime?, completionCallbackType callbackType: AVAudioPlayerNodeCompletionCallbackType) async -> AVAudioPlayerNodeCompletionCallbackType

Parameters

  • file:

    The file to play.

  • when:

    The time the file plays.

  • callbackType:

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

  • completionHandler:

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

See Also

Scheduling Playback