public void StopRecording() { if (this.recording) { this.recording = false; MmException.Try(WaveInterop.waveInStop(this.waveInHandle), "waveInStop"); for (int i = 0; i < this.buffers.Length; i++) { int num = (i + this.lastReturnedBufferIndex + 1) % this.buffers.Length; WaveInBuffer waveInBuffer = this.buffers[num]; if (waveInBuffer.Done) { this.RaiseDataAvailable(waveInBuffer); } } this.RaiseRecordingStopped(null); } }
public void StopRecording() { this.recording = false; this.callbackEvent.Set(); MmException.Try(WaveInterop.waveInStop(this.waveInHandle), "waveInStop"); }