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);
                }
            }));
        }
        /// <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();
        }
        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;
            });
        }
 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
 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
 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);
 }
 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
 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
 private void OnPartialResponseReceived(object sender, PartialSpeechResponseEventArgs e)
 {
     PartialResponseReceived?.Invoke(e.PartialResult);
 }
示例#30
0
 private void OnPartialResponseReceived(object sender, PartialSpeechResponseEventArgs e)
 {
     WriteToLog($"Partial Result: {e.PartialResult}");
 }
 /// <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();
 }
 /// <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();
 }