             } else {
                 endingFrame = UInt32(newValue * internalAudioFile.sampleRate)
                 
-                print("AKAudioPlayer.endTime = \(newValue), endingFrame: \(endingFrame)")
+                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
     ///

        AudioKit.engine.connect(internalPlayer, to: mixer, format: format)
        self.avAudioNode = mixer
        internalPlayer.volume = 1.0
        initialize()
    }
    

    open var startTime: Double {
        get {
            return Double(startingFrame) / internalAudioFile.sampleRate
            
        }
        set {
            //let wasPlaying = playing
            
            // since setting startTime will fill the buffer again, we only want to do this if the
            // data really needs to be updated
            if newValue == internalStartTime {
                //print("startTime is the same, so returning: \(newValue)")
                return
                
            } else if newValue > Double(endingFrame) / internalAudioFile.sampleRate && endingFrame > 0 {
                print("ERROR: AKAudioPlayer cannot set a startTime bigger than the endTime: \(Double(endingFrame) / internalAudioFile.sampleRate) seconds")
                
            } else {
                startingFrame = UInt32(newValue * internalAudioFile.sampleRate)
                
                Swift.print("AKAudioPlayer.startTime = \(newValue), startingFrame: \(startingFrame)")
                
                // now update the buffer
                updatePCMBuffer()
                //stop()
                
                // remember this value for ease of checking redundancy later
                internalStartTime = newValue
            }
            // RF: I don't think this is a good idea. There are many cases where you don't want it to restart on you without
            //explicitly meaning to.
            //            if wasPlaying {
            //                play()
            //            }
        }
    }
    
