コード例 #1
0
        private void ResponceRecived(object sender, PartialSpeechResponseEventArgs e)
        {
            var result = e.PartialResult;

            Dispatcher.Invoke(() =>
            {
                ResponceTxt.Text  = e.PartialResult;
                ResponceTxt.Text += "\n";
            }
                              );
        }
コード例 #2
0
        private void OnPartialResponseReceived_HANDLER(object sender, PartialSpeechResponseEventArgs e)
        {
            string result = e.PartialResult;

            txt_Cikti.BeginInvoke((Action)(() =>
            {
                txt_Cikti.Text = (result);
                txt_Cikti.Text += "\n";
            }
                                           ));
        }
コード例 #3
0
        /// <summary>
        /// Called when a partial response is received.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="PartialSpeechResponseEventArgs"/> instance containing the event data.</param>
        private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
        {
            Console.WriteLine("--- Partial result received by OnPartialResponseReceivedHandler() ---");
            Console.WriteLine("{0}", e.PartialResult);
            var formattedStr = string.Format("{0}", e.PartialResult);

            //this.FontSize = 30;

            this.UpdateStr("{0}", 50, e.PartialResult);
            Console.WriteLine();
        }
コード例 #4
0
 private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     Dispatcher.Invoke(
         (Action)(() =>
     {
         RecognizeResult.Document.Blocks.Clear();
         RecognizeResult.AppendText(e.PartialResult);
         RecognizeResult.SelectAll();
         RecognizeResult.Selection.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Gray);
         RecognizeResult.Selection.Select(RecognizeResult.Document.ContentEnd, RecognizeResult.Document.ContentEnd);
     }));
 }
コード例 #5
0
        /// <summary>
        /// Called when a partial response is received.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">An object that contains the event data.</param>
        private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
        {
            this.lastPartialResult = e.PartialResult;
            var result = this.BuildPartialSpeechRecognitionResult(e.PartialResult);

            // Since this is a partial response, VAD may not yet have signalled the end of speech
            // so just use the last audio packet time (which will probably be ahead).
            this.PostWithOriginatingTimeConsistencyCheck(this.PartialRecognitionResults, result, this.lastAudioOriginatingTime);

            // Post the raw result from the underlying recognition engine
            this.PostWithOriginatingTimeConsistencyCheck(this.PartialSpeechResponseEvent, e, this.lastAudioOriginatingTime);
        }
コード例 #6
0
        public static void onPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
        {
            string response = e.PartialResult;

            Application.Current.Dispatcher.Invoke((async() =>
            {
                bool x;
                getWindow().setSpeechBoxText("Partial: " + response);
                if (!(x = await Agent.checkForObjection(response)))
                {
                    Agent.checkforData(response);
                }
            }));
        }
コード例 #7
0
        /// <summary>
        /// Called when a partial response is received.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="PartialSpeechResponseEventArgs"/> instance containing the event data.</param>
        private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
        {
            Console.WriteLine("--- Partial result received by OnPartialResponseReceivedHandler() ---");
            Console.WriteLine("{0}", e.PartialResult);
            var formattedStr = string.Format("{0}", e.PartialResult);

            //this.FontSize = 30;

            this.UpdateStr("{0}", 50, e.PartialResult);
            if (e.PartialResult.Contains("computer"))
            {
                this.Dispatcher.Invoke(() => { image.Source = new BitmapImage(new Uri("Assets\\img.png", UriKind.Relative)); });
            }
            Console.WriteLine();
        }
コード例 #8
0
        private void ResponseReceived(object sender, PartialSpeechResponseEventArgs e)
        {
            string result = e.PartialResult;


            Dispatcher.Invoke(() =>
            {
                partial = (e.PartialResult);

                Responsetxt.Text  = partial;
                Responsetxt.Text += ("\n");


                continuous = value_senti;
            });
        }
コード例 #9
0
 private void ResponceRecived(object sender, PartialSpeechResponseEventArgs e)
 {
     Dispatcher.Invoke(() =>
         {
             if (e.PartialResult.Contains("start dictation"))
             {
                 ((IBioInfoUserIo) this).OpenEmailDictation(true);
                 _voiceToText.StopRecording();
                 tbTextInput.Text = "";
                 return;
             }
             tbTextInput.Text = e.PartialResult;
             tbTextInput.Text += "\n";
         }
     );
 }
コード例 #10
0
        /// <summary>
        ///     Called when a partial response is received.
        /// </summary>
        void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
        {
            if (recording)
            {
                pingPong++;
                this.Dispatcher.Invoke((Action)(() =>
                {
                    partialString = e.PartialResult;
                    userInput.Text = this.fullText + partialString;

                    /*partialString = e.PartialResult;
                     * userInput.Text = this.fullText + e.PartialResult;
                     */
                }));
            }
        }
コード例 #11
0
 //Textbox에 text입력
 private void ResponseReceived(object sender, PartialSpeechResponseEventArgs e)
 {
     speechRecognitionResult = e.PartialResult;
     Dispatcher.Invoke(() =>
     {
         /*
          * if(e.PartialResult.Contains("am"))
          * {
          *  temp = e.PartialResult;
          *  Responsetxt.Text = temp.Replace("am", "is"); ;
          *  Responsetxt.Text += ("\n");
          * }
          */
         speechRecognition.Text          = (e.PartialResult);
         additionalQuestion.testBox.Text = speechRecognition.Text;/////////////////////////////////////////////////////////
         //mainQuestion.
     });
 }
コード例 #12
0
        /// <summary>
        /// Called when a partial response is received.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="PartialSpeechResponseEventArgs"/> instance containing the event data.</param>
        private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
        {
            Dispatcher.Invoke(
                (Action)(() =>
            {
                this.speechSniplets = e.PartialResult;
                RecEvent q = this.ParseRecEvent(e.PartialResult);
                if (q != null && (q.Kind == RecEventType.Stop || q.Kind == RecEventType.Reset))
                {
                    // we got the final result, so it we can end the mic reco.  No need to do this
                    // for dataReco, since we already called endAudio() on it as soon as we were done
                    // sending all the data.

                    this.micClient.EndMicAndRecognition();
                    dispatchEvent(q);
                }
            }));
        }
コード例 #13
0
 private void PartialResponceRecived(object sender, PartialSpeechResponseEventArgs e)
 {
     Dispatcher.Invoke(() =>
     {
         CallCommand(e);
         if (e.PartialResult.Contains("command mode") || e.PartialResult.Contains("pause"))
         {
             _partialResponces = "";
             _tbCtrl.Text      = _fullResponces + " " + _partialResponces;
             _commandMode      = true;
             return;
         }
         if (_commandMode || _partialResponces == "###")
         {
             _partialResponces = string.Empty;
             return;
         }
         _partialResponces       = AjustPartialResponseText(e.PartialResult);
         _tbCtrl.Text            = _fullResponces + " " + _partialResponces;
         _tbCtrl.SelectionStart  = _fullResponces.Length;
         _tbCtrl.SelectionLength = _fullResponces.Length + _partialResponces.Length + 1;
     });
 }
コード例 #14
0
 private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     ContinueSession(e.PartialResult);
 }
コード例 #15
0
 /// <summary>
 /// Event handler function for partial responses. Prints the response to the debug console
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnPartialResponseReceived(object sender, PartialSpeechResponseEventArgs e)
 {
     Debug.WriteLine($"Partial response received: {e.PartialResult}");
 }
コード例 #16
0
 /// <summary>
 /// Called when a partial response is received.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="PartialSpeechResponseEventArgs"/> instance containing the event data.</param>
 private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     Query = $"{e.PartialResult}";
 }
コード例 #17
0
 private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     WriteLine("RecognitionStatus is PartialResult.");
     this.SendMessage(WebSocketMessageType.PartialResult, e.PartialResult);
 }
コード例 #18
0
ファイル: Client.cs プロジェクト: chan4lk/Cem-Video-Analyzer
 private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     this.SetText(metaText, "--- OnMicrophoneStatus ---");
 }
コード例 #19
0
 private static void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     log.Debug(string.Format("    --> OnPartialResponseReceivedHandler:[{0}]", e.PartialResult));
 }
コード例 #20
0
        private void CallCommand(PartialSpeechResponseEventArgs e)
        {
            if (e.PartialResult.Contains("stop recording"))
            {
                _partialResponces = "###";
                _tbCtrl.Text      = _fullResponces;
                StopRecording();
            }

            if (_commandMode && e.PartialResult.Contains("chemical") && e.PartialResult.Contains("properties"))
            {
                string chemical;
                try
                {
                    chemical      = e.PartialResult.Replace("chemical ", "");
                    chemical      = chemical.Replace(" properties", "");
                    _tbCtrl.Text += "looking up data for " + chemical + " ...\n";
                    _chemOperations.FillChemicalValues(chemical);
                    _tbCtrl.Text += " All Data fully loaded for chemical :" + chemical;
                }
                catch (Exception ex)
                {
                    _tbCtrl.Text += " " + ex.Message;
                }
            }

            if (_commandMode && e.PartialResult.Contains("send email"))
            {
                _emailOperations.SendDictationEmail(TbEmailAddress.Text, TbDictation.Text);
                Close();
            }

            if (_commandMode && e.PartialResult.Contains("email address"))
            {
                _partialResponces  = "###";
                _tbCtrl.Background = Brushes.White;
                _tbCtrl            = TbEmailAddress;
                _fullResponces     = _tbCtrl.Text;
                SetTextBox();
                _commandMode = false;
            }

            if (_commandMode && e.PartialResult.Contains("subject"))
            {
                _partialResponces  = "###";
                _tbCtrl.Background = Brushes.White;
                _tbCtrl            = TbSubject;
                _fullResponces     = _tbCtrl.Text;
                SetTextBox();
                _commandMode = false;
            }

            if (_commandMode && e.PartialResult.Contains("content"))
            {
                _partialResponces  = "###";
                _tbCtrl.Background = Brushes.White;
                _tbCtrl            = TbDictation;
                _fullResponces     = _tbCtrl.Text;
                SetTextBox();
                _commandMode = false;
            }

            if (_commandMode && e.PartialResult.Contains("exit command") || e.PartialResult.Contains("resume"))
            {
                _partialResponces = "###";
                _commandMode      = false;
                _fullResponces    = TbDictation.Text;
            }

            //chemical properties
            if (_commandMode && e.PartialResult.Contains("target chemical"))
            {
                _tbCtrl.Text += _chemOperations.Chemical;
            }

            if (_commandMode && e.PartialResult.Contains("mw") || e.PartialResult.Contains("molecular weight"))
            {
                _tbCtrl.Text += " Molecular Weight = " + _chemOperations.MolecularWeight;
            }

            if (_commandMode && e.PartialResult.Contains("formula"))
            {
                var text = " Formula = " + _chemOperations.MolecularWeight;
                _tbCtrl.Text   += text;
                _fullResponces += text;
            }

            if (_commandMode && e.PartialResult.Contains("synonym"))
            {
                var text = "Synonyms  = " + _chemOperations.Synonyms;
                _tbCtrl.Text   += text;
                _fullResponces += text;
            }

            if (_commandMode && e.PartialResult.Contains("chemical id"))
            {
                var text = "CID's  = " + _chemOperations.CiDs;
                _tbCtrl.Text   += text;
                _fullResponces += text;
            }

            if (_commandMode && e.PartialResult.Contains("keys"))
            {
                var text = "InCHI keys  = " + _chemOperations.CiDs;
                _tbCtrl.Text   += text;
                _fullResponces += text;
            }
        }
コード例 #21
0
ファイル: MainWindow.xaml.cs プロジェクト: dc620/Speech
 private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     WriteLine("{0}", e.PartialResult);
     WriteLine("");
 }
コード例 #22
0
 private void Client_OnPartialResponseReceived(object sender, PartialSpeechResponseEventArgs e)
 {
     systemLog.Debug($"{ prefix } Partial response received");
     systemLog.Debug(e.PartialResult);
 }
コード例 #23
0
 private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     WriteTextBoxLine(txtPartial, e.PartialResult);
 }
コード例 #24
0
 private void DataClient_OnPartialResponseReceived(object sender, PartialSpeechResponseEventArgs e)
 {
     _parts.Add(e.PartialResult);
 }
コード例 #25
0
ファイル: MainWindow.xaml.cs プロジェクト: erickbp/IoT
 private void OnPartialResponseReceived(object sender, PartialSpeechResponseEventArgs e)
 {
     WriteToLog($"Partial Result: {e.PartialResult}");
 }
コード例 #26
0
 /// <summary>
 /// Called when a partial response is received.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="PartialSpeechResponseEventArgs"/> instance containing the event data.</param>
 private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     ;
 }
コード例 #27
0
 /// <summary>
 ///     Called when a partial response is received;
 /// </summary>
 void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     Console.WriteLine("********* Partial Result *********");
     Console.WriteLine("{0}", e.PartialResult);
     Console.WriteLine();
 }
コード例 #28
0
 private void OnPartialReponseReceiveHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     RecognizeText.Add(e.PartialResult);
 }
コード例 #29
0
ファイル: SpeechRecManager.cs プロジェクト: ArielY15/AIPhone
 private void OnPartialResponseReceived(object sender, PartialSpeechResponseEventArgs e)
 {
     PartialResponseReceived?.Invoke(e.PartialResult);
 }
コード例 #30
0
ファイル: MainWindow.xaml.cs プロジェクト: simple0812/IoT
 private void OnPartialResponseReceived(object sender, PartialSpeechResponseEventArgs e)
 {
     WriteToLog($"Partial Result: {e.PartialResult}");
 }
コード例 #31
0
 /// <summary>
 ///     Called when a partial response is received.
 /// </summary>
 void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     if (recording)
     {
         pingPong++;
         this.Dispatcher.Invoke((Action)(() =>
         {
             partialString = e.PartialResult;
             userInput.Text = this.fullText + partialString;
             /*partialString = e.PartialResult;
             userInput.Text = this.fullText + e.PartialResult;
              */
         }));
     }
 }
コード例 #32
0
 /// <summary>
 /// Called when a partial response is received.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="PartialSpeechResponseEventArgs"/> instance containing the event data.</param>
 private void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     this.WriteLine("--- Partial result received by OnPartialResponseReceivedHandler() ---");
     this.WriteLine("{0}", e.PartialResult);
     this.WriteLine();
 }
コード例 #33
0
 /// <summary>
 ///     Called when a partial response is received; 
 /// </summary>
 void OnPartialResponseReceivedHandler(object sender, PartialSpeechResponseEventArgs e)
 {
     Console.WriteLine("********* Partial Result *********");
     Console.WriteLine("{0}", e.PartialResult);
     Console.WriteLine();
 }