public void Stop()
        {
            if (_state == RecorderState.Stopped || _state == RecorderState.Unknown)
            {
                throw new InvalidOperationException("No recording in progress.");
            }

            ReleaseMicrophone();

            _state       = RecorderState.Stopped;
            _isCapturing = false;
            _writer.Flush();

            _stream.Dispose();
        }
Exemple #2
0
        public void Stop()
        {
            if (_state == RecorderState.Stopped || _state == RecorderState.Unknown)
            {
                throw new InvalidOperationException("No recording in progress.");
            }

            if (_capture.StopCapture())
            {
                _state = RecorderState.Stopped;
                _timer.Stop();
                _isCapturing = false;

                _writer.Flush();
            }

            _stream.Dispose();
        }