public void Stop() { this.ThreadListen.Suspend(); if (this.m_Player != null) { try { this.m_Player.Dispose(); } finally { this.m_Player = null; } } if (this.m_Recorder != null) { try { this.m_Recorder.Dispose(); } finally { this.m_Recorder = null; } } this.m_Fifo.Flush(); }
public void Start() { this.Stop(); this.ThreadListen.Resume(); try { global::WaveLib.WaveFormat fmt = new global::WaveLib.WaveFormat(22050, 16, 2); this.m_Player = new global::WaveLib.WaveOutPlayer(-1, fmt, 32000, 5, new global::WaveLib.BufferEventHandler(this.Filler)); this.m_Recorder = new global::WaveLib.WaveInRecorder(-1, fmt, 32000, 5, new global::WaveLib.BufferEventHandler(this.DataSend)); } catch { this.Stop(); throw; } }