scheduleSegment(_:startingFrame:frameCount:at:completionCallbackType:completionHandler:)
Schedules the playing of an audio file segment with a callback option you specify.
Declaration
func scheduleSegment(_ file: AVAudioFile, startingFrame startFrame: AVAudioFramePosition, frameCount numberFrames: AVAudioFrameCount, at when: AVAudioTime?, completionCallbackType callbackType: AVAudioPlayerNodeCompletionCallbackType, completionHandler: (@Sendable (AVAudioPlayerNodeCompletionCallbackType) -> Void)? = nil)func scheduleSegment(_ file: AVAudioFile, startingFrame startFrame: AVAudioFramePosition, frameCount numberFrames: AVAudioFrameCount, at when: AVAudioTime?, completionCallbackType callbackType: AVAudioPlayerNodeCompletionCallbackType) async -> AVAudioPlayerNodeCompletionCallbackTypeParameters
- file:
The file to play.
- startFrame:
The starting frame position in the stream.
- numberFrames:
The number of frames to play.
- when:
The time the region 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 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:completionHandler:)scheduleBuffer(_:at:options:completionHandler:)scheduleBuffer(_:completionHandler:)scheduleBuffer(_:at:options:completionCallbackType:completionHandler:)scheduleBuffer(_:completionCallbackType:completionHandler:)AVAudioPlayerNodeBufferOptionsAVAudioPlayerNodeCompletionCallbackTypeAVAudioPlayerNodeCompletionHandler