public void Stop() { // // Ensure that a reader object has been instantiated. // if (IsDisposed()) { throw new COMException("Instance has been Disposed", E_Unexpected); } m_pReader.Stop(); // // Reset the wave output device // if (IntPtr.Zero != m_hWaveOut) { int woe = waveOut.Reset(m_hWaveOut); waveOut.ThrowExceptionForError(woe); // // Wait for all audio headers to be unprepared. // m_hAsyncEvent.WaitOne(); } }
private void CloseConfig() { reader.Stop(); reader.Close(); sink.Disconnect(); writer.EndWriting(); }
private void TestControl() { m_read.Start(0, 50000000, 1.0f, IntPtr.Zero); while (m_SampleCount == 0) { System.Threading.Thread.Sleep(1); } m_read.Pause(); System.Threading.Thread.Sleep(100); int cur = m_SampleCount; System.Threading.Thread.Sleep(500); Debug.Assert(cur == m_SampleCount); m_read.Resume(); System.Threading.Thread.Sleep(100); Debug.Assert(m_SampleCount != cur); m_read.Stop(); WaitForStatus(Status.Stopped); }