     }
 
     // Restarts the engine after audio output has been changed, like headphones plugged in.
-    @objc fileprivate static func restartEngineAfterRouteChange(_ notification: Notification) {
+    private static func restartEngineAfterRouteChange(_ notification: Notification) {
         if shouldBeRunning {
             do {
                 try self.engine.start()


    // Listen to changes in audio configuration
    // and restart the audio engine if it stops and should be playing
    @objc fileprivate static func audioEngineConfigurationChange(_ notification: Notification) -> Void {

        if shouldBeRunning && !engine.isRunning {
            do {


    /// Reference to the AV Audio Engine
    open static let engine = AVAudioEngine()

    override private init() { }

    static var shouldBeRunning = false

