Contents

scheduleSegment(_:startingFrame:frameCount:at:completionHandler:)

Schedules the playing of an audio file segment.

Declaration

func scheduleSegment(_ file: AVAudioFile, startingFrame startFrame: AVAudioFramePosition, frameCount numberFrames: AVAudioFrameCount, at when: AVAudioTime?, completionHandler: (@Sendable () -> Void)? = nil)
func scheduleSegment(_ file: AVAudioFile, startingFrame startFrame: AVAudioFramePosition, frameCount numberFrames: AVAudioFrameCount, at when: AVAudioTime?) async

Parameters

  • file:

    The URL of the file to play.

  • startFrame:

    The starting frame position in the stream.

  • numberFrames:

    The number of frames to play.

  • when:

    The time the buffer plays. For more information, see Avaudioplayernode.

  • completionHandler:

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

See Also

Scheduling Playback