/// <summary> /// Stop recording /// </summary> public void StopRecording() { recording = false; MmException.Try(WaveInterop.waveInStop(waveInHandle), "waveInStop"); //MmException.Try(WaveInterop.waveInReset(waveInHandle), "waveInReset"); // Don't actually close yet so we get the last buffer }
/// <summary> /// Stop recording /// </summary> public void StopRecording() { //if (!recording) // throw new InvalidOperationException("Not recording"); recording = false; MmException.Try(WaveInterop.waveInStop(waveInHandle), "waveInStop"); //MmException.Try(WaveInterop.waveInReset(waveInHandle), "waveInReset"); }
/// <summary> /// Stop recording /// </summary> public void StopRecording() { if (captureState != CaptureState.Stopped) { captureState = CaptureState.Stopping; callbackEvent.Set(); // signal the thread to exit MmException.Try(WaveInterop.waveInStop(waveInHandle), "waveInStop"); } }
/// <summary> /// Stop recording /// </summary> public void StopRecording() { if (captureState != CaptureState.Stopped) { captureState = CaptureState.Stopping; MmException.Try(WaveInterop.waveInStop(waveInHandle), "waveInStop"); //Reset, triggering the buffers to be returned MmException.Try(WaveInterop.waveInReset(waveInHandle), "waveInReset"); callbackEvent.Set(); // signal the thread to exit } }
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); } }
/// <summary> /// Stop recording /// </summary> public void StopRecording() { if (recording) { recording = false; MmException.Try(WaveInterop.waveInStop(waveInHandle), "waveInStop"); // report the last buffers, sometimes more than one, so taking care to report them in the right order for (int n = 0; n < buffers.Length; n++) { int index = (n + lastReturnedBufferIndex + 1) % buffers.Length; var buffer = buffers[index]; if (buffer.Done) { RaiseDataAvailable(buffer); } } RaiseRecordingStopped(null); } //MmException.Try(WaveInterop.waveInReset(waveInHandle), "waveInReset"); // Don't actually close yet so we get the last buffer }
/// <summary> /// Stop recording /// </summary> public void StopRecording() { recording = false; this.callbackEvent.Set(); // signal the thread to exit MmException.Try(WaveInterop.waveInStop(waveInHandle), "waveInStop"); }
public void StopRecording() { this.recording = false; this.callbackEvent.Set(); MmException.Try(WaveInterop.waveInStop(this.waveInHandle), "waveInStop"); }