             scheduleSegment(at: audioTime)
         }
 
-        if #available(OSX 10.13, *) {
-
+        if #available(iOS 11, macOS 10.13, tvOS 11, *) {
+            // nothing further is needed as the completion is specified in the scheduler
         } else {
             completionTimer?.invalidate()
             prerollTimer?.invalidate()


        let frameCount = (audioFile.samplesCount - startFrame) - (audioFile.samplesCount - endFrame)

        if #available(OSX 10.13, *) {
            playerNode.scheduleSegment(audioFile,
                                       startingFrame: startFrame,
                                       frameCount: AVAudioFrameCount(frameCount),

    // MARK: - Completion Handlers

    // this will be the method in the scheduling completionHandler >= 10.13
    @available(iOS 11, macOS 10.13, tvOS 11, *)
    @objc private func handleCallbackComplete(completionType: AVAudioPlayerNodeCompletionCallbackType) {
        DispatchQueue.main.async {
            self.completionHandler?()
