Example #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (!_disposed)
     {
         Stop();
         _masteringVoice.Dispose();
         _masteringVoice = null;
         _xaudio2.Dispose();
         _xaudio2 = null;
     }
     _disposed = true;
 }
Example #2
0
        public void Stop()
        {
            if (_isPlaying)
            {
                StreamingSourceVoiceListener.Default.Remove(_streamingSourceVoice);
                _streamingSourceVoice.Stop();
                _streamingSourceVoice.Dispose();
                _masteringVoice.Dispose();
                _waveSource.Dispose();

                _isPlaying = false;
            }
        }