예제 #1
0
        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();
        }
예제 #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();
        }