     
     fileprivate func secondsToAVAudioTime(_ time: Double) -> AVAudioTime {
         let sampleTime = AVAudioFramePosition(time * internalAudioFile.sampleRate)
-        let avTime = AVAudioTime(hostTime: mach_absolute_time(), sampleTime: sampleTime,
-                                 atRate: internalAudioFile.sampleRate)
-        return avTime
-    }
-    
-    /// scheduleBuffer either now or at a future time
+        return AVAudioTime(hostTime: mach_absolute_time(), sampleTime: sampleTime, atRate: internalAudioFile.sampleRate)
+    }
+    
     fileprivate func scheduleBuffer(_ atTime: AVAudioTime? = nil) {
         if audioFileBuffer != nil {
-            internalPlayer.scheduleBuffer(audioFileBuffer!, at: atTime, options: .interrupts,
-                                          completionHandler: internalCompletionHandler)
-            
-            // if scheduling in the future, we can prepare the player in advance so it's ready to roll
+            //internalPlayer.scheduleBuffer(audioFileBuffer!, completionHandler: internalCompletionHandler)
+            internalPlayer.scheduleBuffer(audioFileBuffer!, at: atTime, options: .interrupts, completionHandler: internalCompletionHandler)
+            
             if atTime != nil {
                 internalPlayer.prepare(withFrameCount: framesToPlayCount)
             }
         }
     }
     
-    /// reads from the audio file into audioFileBuffer
     fileprivate func updatePCMBuffer() {
         if internalAudioFile.samplesCount > 0 {
             internalAudioFile.framePosition = Int64(startingFrame)

        totalFrameCount = UInt32(internalAudioFile.length)
        startingFrame = 0
        endingFrame = totalFrameCount

        if internalAudioFile.length > 0 {
            // prefill the buffer
            updatePCMBuffer()
            
        } else {
            print("AKAudioPlayer Warning:  \"\(internalAudioFile.fileNamePlusExtension)\" is an empty file")

            } else {
                endingFrame = UInt32(newValue * internalAudioFile.sampleRate)
                
                Swift.print("AKAudioPlayer.endTime = \(newValue), endingFrame: \(endingFrame)")
                
                // now update the buffer
                updatePCMBuffer()
                //stop()
                
                // remember this value for ease of checking redundancy later
                internalEndTime = newValue
            }
            //            if wasPlaying {
            //                play()
            //            }
        }
    }
    
    /// Sets the time in the future when playback will commence. For immediately playback, leave it 0.
    open var scheduledTime: Double = 0
    
    
    // MARK: - Initialization
    
    
    /// Initialize the audio player
    ///
