         return FXAudioPlayerEngine(asset: asset)
     }
 }
+
+
+extension MPMusicPlayerController {
+    class var cleanApplicationMusicPlayer: MPMusicPlayerController {
+        let result = applicationMusicPlayer
+        result.setQueue(with: [])
+        result.currentPlaybackTime = 0.0
+        return result
+    }
+}

            // necessary for audio processing. This optimization may need to be made conditional if
            // we hit similar issues.
            timePitch.bypass = (rate == kRateCenter)
            
            
            DispatchQueue.main.async {
                self.delegate?.playbackRateAdjusted()

    }
    
    private func setupPlayer() {
        player.repeatMode = .none
        player.shuffleMode = .off

        if let id = mediaItem?.playbackStoreID {
            player.setQueue(with: [id])
            player.prepareToPlay() { error in
                guard let error = error else {
                    return
                }
                
                print("Error in MPMusicPlayerController.prepareToPlay: \(error)")
            }
        }
    }
}

