private void StartSpectrumVisualizer()
 {
     if (SpectrumVisualizer != null)
     {
         SpectrumVisualizer.SetTrack(ActiveTrack.Path, waveOut.OutputWaveFormat.SampleRate, trackReader);
         SpectrumVisualizer.Start();
     }
 }
 public void PauseTrack()
 {
     if (PlaybackState == PlaybackState.Playing)
     {
         waveOut.Pause();
         trackReaderPosition = trackReader.Position;
         SpectrumVisualizer?.Pause();
         PlaybackState = PlaybackState.Paused;
     }
 }
 public void ResumeTrack()
 {
     if (PlaybackState == PlaybackState.Paused)
     {
         trackReader.Seek(trackReaderPosition, SeekOrigin.Begin);
         waveOut.Init(trackReader);
         waveOut.Play();
         trackReaderPosition = -1;
         SpectrumVisualizer?.Resume();
         PlaybackState = PlaybackState.Playing;
     }
 }
 public void StopTrack()
 {
     if (ActiveTrack != null)
     {
         SpectrumVisualizer?.Stop();
         waveOut.Dispose();
         waveOut = null;
         trackReader.Dispose();
         trackReader   = null;
         ActiveTrack   = null;
         PlaybackState = PlaybackState.StoppedManually;
     }
 }
 public void Dispose()
 {
     StopTrack();
     SpectrumVisualizer?.Dispose();
 }