public void StartRecoding(string recordingDeviceId, string outputFolderPath, bool skipCommertials, int bitrate)
        {
            if (!IsRecording)
            {
                _recordingDeviceId = recordingDeviceId;
                _skipCommertials   = skipCommertials;
                _bitrate           = bitrate;

                _recorder   = new SoundCardRecorder(new DirectoryInfo(outputFolderPath));
                IsRecording = true;
            }
        }
        public void StopRecording( )
        {
            if (IsRecording)
            {
                var file = _recorder?.Stop();
                _recorder?.Dispose();
                _recorder = null;

                //Delete current recording on cancellation
                if (file != null && file.WavFile.Exists)
                {
                    file.WavFile.Delete();
                }
                IsRecording = false;
            }
        }