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?) asyncParameters
- 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
scheduleFile(_:at:completionHandler:)scheduleFile(_:at:completionCallbackType:completionHandler:)scheduleSegment(_:startingFrame:frameCount:at:completionCallbackType:completionHandler:)scheduleBuffer(_:at:options:completionHandler:)scheduleBuffer(_:completionHandler:)scheduleBuffer(_:at:options:completionCallbackType:completionHandler:)scheduleBuffer(_:completionCallbackType:completionHandler:)AVAudioPlayerNodeBufferOptionsAVAudioPlayerNodeCompletionCallbackTypeAVAudioPlayerNodeCompletionHandler