public void Stop() { m_audioDataMutex.WaitOne(); m_isRunning = false; m_isFlushing = false; if (m_audioGraph != null) { m_audioGraph.Stop(); } if (m_deviceOutputNode != null) { m_deviceOutputNode.Dispose(); m_deviceOutputNode = null; } if (m_frameInputNode != null) { m_frameInputNode.Dispose(); m_frameInputNode = null; } if (m_audioGraph != null) { m_audioGraph.Dispose(); m_audioGraph = null; } m_audioData = null; m_audioDataMutex.ReleaseMutex(); }
public void StopAudioOutput() { AudioInStream = null; _FrameInputNode?.Stop(); _FrameInputNode?.Dispose(); _FrameInputNode = null; }
/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> private void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // Release managed objects. Stop(); AudioGraph.Dispose(); frameInputNode.Dispose(); } disposedValue = true; } }
public void Dispose() { _OutputNode.Dispose(); _FrameInputNode.Dispose(); }