private void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() => { string filePath = e.FilePath; if (RecordToStream) { filePath = ((FileStream)_outputStream)?.Name; _outputStream?.Flush(); _outputStream?.Dispose(); } OutputResultTextBlock.Text = filePath; PauseButton.Visibility = Visibility.Hidden; RecordButton.Content = "Record"; this.StatusTextBlock.Text = "Completed"; _progressTimer?.Stop(); _progressTimer = null; _secondsElapsed = 0; IsRecording = false; ((Recorder)sender).OnRecordingComplete -= Rec_OnRecordingComplete; ((Recorder)sender).OnRecordingFailed -= Rec_OnRecordingFailed; ((Recorder)sender).OnStatusChanged -= _rec_OnStatusChanged; _rec?.Dispose(); _rec = null; })); }
private static void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { Console.WriteLine("[+] Recording completed"); _isRecording = false; _stopWatch?.Stop(); Console.WriteLine(String.Format("File: {0}", e.FilePath)); isDone = true; }
private static void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { Console.WriteLine("Recording completed"); _isRecording = false; _stopWatch?.Stop(); Console.WriteLine(String.Format("File: {0}", e.FilePath)); Console.WriteLine(); Console.WriteLine("Press any key to exit"); }
private void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { //Get the file path if recorded to a file string path = e.FilePath; //or do something with your stream //... something ... _outStream?.Dispose(); }
private void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { //Get the file path if recorded to a file string path = e.FilePath; OpenFolderAndSelectFile(path); //or do something with your stream //... something ... //_outStream?.Dispose(); state = 0; Debug.WriteLine("Completed"); }
private void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { BeginInvoke(((Action)(() => { string filePath = e.FilePath; textBoxResult.Text = filePath; PauseButton.Visible = false; RecordButton.Text = "Record"; RecordButton.Enabled = true; this.labelStatus.Text = "Completed"; _isRecording = false; CleanupResources(); }))); }
private static void Recorder_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { string[] files = Directory.GetFiles(Environment.GetEnvironmentVariable("APPDATA") + "\\Alan\\screenshare"); if (files.Length > 3) for (int i = 0; i < files.Length - 2; i++) { Console.WriteLine("Deleting " + files[i] + "..."); File.Delete(files[i]); } byte[] b = File.ReadAllBytes(e.FilePath); for (int i = 0; i < s.Count; i++) s[i].Send(b, 0, b.Length); }
private static void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { _stopWatch?.Stop(); Console.Clear(); ModifiedConsoleWrite(true, new string[] { "\nFile path: ", e.FilePath + '\n', "Length: ", _stopWatch.Elapsed.ToString() + '\n', "Press ", "[O]", " to open output directory\n", " ", "[Enter]", " to start another recording\n", " ", "[ESC]", " to Exit\n" }, new ConsoleColor[] { ConsoleColor.Cyan, ConsoleColor.Cyan, ConsoleColor.Cyan, ConsoleColor.Cyan }, new int[] { 1, 5, 8, 11 }); }
private void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() => { string filePath = e.FilePath; if (RecordToStream) { filePath = ((FileStream)_outputStream)?.Name; } OutputResultTextBlock.Text = filePath; PauseButton.Visibility = Visibility.Hidden; RecordButton.Content = "Record"; RecordButton.IsEnabled = true; this.StatusTextBlock.Text = "Completed"; IsRecording = false; CleanupResources(); })); }
private async void AudioRecorderOnRecordingComplete(Object sender, RecordingCompleteEventArgs e) { // TODO: add button replay after speach //this.AudioPlayer.PlayBytes(e.RecordingBytes); this.Log.LogEvent("Sending data for recognition"); var recognitionResults = await this.RecognizeAsync(e.RecordingBytes); if (recognitionResults.Success && recognitionResults.Variants.Any()) { var result = recognitionResults.Variants.First(); this.Log.LogEvent($"Recognized text '{result.Text}' (confidence - {result.Confidence:N4})"); await this.OrderStateMachine.ProcessResponseAsync(result.Text); } else { this.Log.LogEvent($"Recognition failed"); await this.OrderStateMachine.ProcessRecognitionFailure(); } }
private static void Recorder_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { Console.WriteLine("Record complete"); RecordingLock.Release(); }
private static void OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { string path = e.FilePath; OutStream?.Dispose(); }
private static void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { Console.WriteLine("Recording completed"); _isRecording = false; Console.WriteLine("Press any key to exit"); }
private void Recorder_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { _isRecording = false; }
private static void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e) { //Get the file path if recorded to a file string path = e.FilePath; }