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