Ejemplo n.º 1
0
        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;
            }));
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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");
 }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        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");
        }
Ejemplo n.º 6
0
        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();
            })));
        }
Ejemplo n.º 7
0
        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);

        }
Ejemplo n.º 8
0
        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 });
        }
Ejemplo n.º 9
0
        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();
            }));
        }
Ejemplo n.º 10
0
        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();
            }
        }
Ejemplo n.º 11
0
 private static void Recorder_OnRecordingComplete(object sender, RecordingCompleteEventArgs e)
 {
     Console.WriteLine("Record complete");
     RecordingLock.Release();
 }
Ejemplo n.º 12
0
        private static void OnRecordingComplete(object sender, RecordingCompleteEventArgs e)
        {
            string path = e.FilePath;

            OutStream?.Dispose();
        }
Ejemplo n.º 13
0
 private static void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e)
 {
     Console.WriteLine("Recording completed");
     _isRecording = false;
     Console.WriteLine("Press any key to exit");
 }
Ejemplo n.º 14
0
 private void Recorder_OnRecordingComplete(object sender, RecordingCompleteEventArgs e)
 {
     _isRecording = false;
 }
Ejemplo n.º 15
0
 private static void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e)
 {
     //Get the file path if recorded to a file
     string path = e.FilePath;
 }