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

        let bufferOptions: AVAudioPlayerNodeBufferOptions = isLooping ? [.loops, .interrupts] : [.interrupts]

        //Swift.print("Scheduling buffer...\(startTime) to \(endTime)")
        if #available(OSX 10.13, *) {
            playerNode.scheduleBuffer(buffer,
                                      at: audioTime,
                                      options: bufferOptions,


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

        if #available(iOS 11, macOS 10.13, tvOS 11, *) {
            playerNode.scheduleSegment(audioFile,
                                       startingFrame: startFrame,
                                       frameCount: AVAudioFrameCount(frameCount),
