             return false
         }
         
+        deregisterForMediaServerNotifications()
         engine.stop()
         
         return !engine.isRunning

    
    private func _stop() {
        stopEngine()
        
        _reset()
    }
    

            }
        }
    }
    
    func deregisterForMediaServerNotifications() {
        NotificationCenter.default.removeObserver(self,
                                                  name: AVAudioSession.interruptionNotification,
                                                  object: AVAudioSession.sharedInstance())
        NotificationCenter.default.removeObserver(self,
                                                  name: AVAudioSession.mediaServicesWereResetNotification,
                                                  object: AVAudioSession.sharedInstance())
        NotificationCenter.default.removeObserver(self,
                                                  name: AVAudioSession.routeChangeNotification,
                                                  object: AVAudioSession.sharedInstance())
    }
    
    #else
    private func registerForMediaServerNotifications() {
        //TODO: Support media state notifications for non-iOS platforms
