Example #1
0
 public void Dispose()
 {
     StopPlayback();
     _soundOut?.Dispose();
     _soundSource?.Dispose();
     _simpleNotificationSource?.Dispose();
     _currentMemoryStream?.Dispose();
 }
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         // free managed resources
         if (_fadingService.IsFading)
         {
             _fadingService.Cancel();
         }
         StopPlayback();
         _soundOut?.Dispose();
         _soundOut = null;
         _soundSource?.Dispose();
         SoundOutProvider.Dispose();
         _loopStream?.Dispose();
         _equalizer?.Dispose();
         _simpleNotificationSource?.Dispose();
         _soundSourceLoadingToken?.Dispose();
     }
     // free native resources if there are any.
 }