Пример #1
0
 /* Dictation complete event handler
  * Converts the user input array to a single string. If no user input was recognized,
  * uses TTS to tell the user that no input was recognized. Otherwise, tells the user
  * what was heard and tries to convert it to a location. If conversion was successful
  * then the user will be guided to the route, otherwise use TTS to inform the user that
  * a route could not be found. Restarts the keyword recognizer whether a route was found
  * or not incase the user wants to change their location.
  */
 public void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
 {
     userInputLength = 0;
     Debug.Log("SI: Dictation complete, stopped listening");
     userInputStr = string.Join(" ", userInputArr).TrimEnd();
     Debug.Log("SI: You said " + userInputStr);
     if (emptyInput(userInputStr))
     {
         Say("Sorry, I did not catch that. Please try again.");
     }
     else
     {
         string StrToSend = "Your chosen destination is " + userInputStr;
         Say(StrToSend);
         try
         {
             router.PlaceNameToCoords(userInputStr);
         }
         catch
         {
             Say("Sorry, I cannot find a route to " + userInputStr + ", please choose another destination.");
         }
     }
     for (int i = 0; i < userInputArr.Length; i++)
     {
         userInputArr[i] = null;
     }
     PhraseRecognitionSystem.Restart();
 }
 private void dictationComplete(DictationCompletionCause cause)
 {
     if (cause != DictationCompletionCause.Complete)
     {
         Debug.LogErrorFormat("Dictation completed unsuccessfully: {0}.", cause);
     }
 }
Пример #3
0
 /// <summary>
 /// Function for the DictationHandler to notify user of dictation ending
 /// For a reason other than user input. Displays Cause on dictationHUD.
 /// </summary>
 /// <param name="cause">The reason for DictationCompletion</param>
 public void NotifyDone(DictationCompletionCause cause)
 {
     if (activeHUD)
     {
         dictationHUDText.text = "Recording stopped: " + cause + dismissMessage;
     }
 }
Пример #4
0
 /// <summary>
 /// This handler is called every time the Dictation completes
 /// </summary>
 private void DictationRecognizer_DictationComplete(DictationCompletionCause completionCause)
 {
     if (completionCause != DictationCompletionCause.Complete)
     {
         Results.instance.SetSubtitleContent(@"¯\_(ツ)_/¯");
     }
 }
Пример #5
0
 private void DictationRecogniser_DictationComplete(DictationCompletionCause completionCause)
 {
     if (completionCause != DictationCompletionCause.Complete)
     {
         Debug.LogWarningFormat("Dictation completed unsuccessfully: {0}.", completionCause);
     }
 }
Пример #6
0
    /// <summary>
    /// thrown when engine has some messages, that are not specifically errors
    /// </summary>
    /// <param name="completionCause"></param>
    private void DictationRecognizer_OnDictationComplete(DictationCompletionCause completionCause)
    {
        if (completionCause != DictationCompletionCause.Complete)
        {
            Debug.LogWarningFormat("Dictation completed unsuccessfully: {0}.", completionCause);


            switch (completionCause)
            {
            case DictationCompletionCause.TimeoutExceeded:
            case DictationCompletionCause.PauseLimitExceeded:
                //we need a restart
                CloseDictationEngine();
                StartDictationEngine();
                break;

            case DictationCompletionCause.UnknownError:
            case DictationCompletionCause.AudioQualityFailure:
            case DictationCompletionCause.MicrophoneUnavailable:
            case DictationCompletionCause.NetworkFailure:
                //error without a way to recover
                CloseDictationEngine();
                break;

            case DictationCompletionCause.Canceled:
            //happens when focus moved to another application

            case DictationCompletionCause.Complete:
                CloseDictationEngine();
                StartDictationEngine();
                break;
            }
        }
    }
Пример #7
0
    private void DictationRecognizer_OnDictationComplete(DictationCompletionCause completionCause)
    {
        if (completionCause != DictationCompletionCause.Complete)
        {
            Debug.LogWarningFormat("Dictation completed unsuccessfully: {0}.", completionCause);


            switch (completionCause)
            {
            case DictationCompletionCause.TimeoutExceeded:
            case DictationCompletionCause.PauseLimitExceeded:
                CloseDictationEngine();
                StartDictationEngine();
                break;

            case DictationCompletionCause.UnknownError:
            case DictationCompletionCause.AudioQualityFailure:
            case DictationCompletionCause.MicrophoneUnavailable:
            case DictationCompletionCause.NetworkFailure:
                CloseDictationEngine();
                break;

            case DictationCompletionCause.Canceled:
            case DictationCompletionCause.Complete:
                CloseDictationEngine();
                StartDictationEngine();
                break;
            }
        }
    }
Пример #8
0
    private void OnDictationCompleteHandler(DictationCompletionCause cause)
    {
        StringBuilder builder = new StringBuilder();

        builder.AppendFormat(cause + Environment.NewLine);
        Debug.Log(builder.ToString());
    }
 /// <summary>
 /// This event is fired when the recognizer stops, whether from Stop() being called, a timeout occurring, or some other error.
 /// Typically, this will simply return "Complete". In this case, we check to see if the recognizer timed out.
 /// </summary>
 /// <param name="cause">An enumerated reason for the session completing.</param>
 private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
 {
     if (cause == DictationCompletionCause.TimeoutExceeded)
     {
         Manager.Set_isTalking(false);
     }
 }
Пример #10
0
 public void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
 {
     //Shuts off dictator and restarts keyword recognizer
     Debug.Log("Dictation Timeout");
     D_Recognizer.Dispose();
     PhraseRecognitionSystem.Restart();
 }
Пример #11
0
        private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
        {
            // If Timeout occurs, the user has been silent for too long.
            // With dictation, the default timeout after a recognition is 20 seconds.
            // The default timeout with initial silence is 5 seconds.

            StopRecording(null);
        }
Пример #12
0
    /* What to do when a recognition completes (also by timeout) */
    private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
    {
        //on any cause for completion...
        wild.finish();
        dictationRecognizer.DictationComplete -= DictationRecognizer_DictationComplete;

        Debug.Log(TAG + "Dictation complete: " + cause);
    }
Пример #13
0
 public void OnDictationComplete(DictationCompletionCause cause)
 {
     //Debug.Log("OnDictationCompleteStart");
     //Debug.Log("Dictation Complete: " + cause.ToString());
     _dictationRecognizer.Stop();
     _dictationStarted = false;
     //Debug.Log("OnDictationCompleteStop");
 }
 /// <summary>
 ///  If an error occurs, the node is being messaged about it.
 ///
 /// @param[in]  cause   the cause for the error
 /// </summary>
 private void onDictationComplete(DictationCompletionCause cause)
 {
     pling.Play(0);
     if (cause != DictationCompletionCause.Complete)
     {
         R.error();
     }
 }
Пример #15
0
 void onDictationComplete(DictationCompletionCause cause)
 {
     // write your logic here
     if (cause != DictationCompletionCause.Complete)
     {
         Debug.LogErrorFormat("Dictation completed unsuccessfully: {0}.", cause);
     }
 }
Пример #16
0
 private void DictationRecognizer_InvokeCompletedEvent(DictationCompletionCause cause)
 {
     DictationRecognizer.DictationCompletedDelegate dictationComplete = this.DictationComplete;
     if (dictationComplete != null)
     {
         dictationComplete(cause);
     }
 }
 private void DictationRecognizer_InvokeCompletedEvent(DictationCompletionCause cause)
 {
     DictationCompletedDelegate dictationComplete = this.DictationComplete;
     if (dictationComplete != null)
     {
         dictationComplete(cause);
     }
 }
Пример #18
0
 private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
 {
     //Debug.Log("Done talking: "+ cause);
     Debug.Log("Response jump to: " + wild.wildcardJumpID);
     interactionManager.eventIndex          = wild.wildcardJumpID;
     dictationRecognizer.DictationComplete -= DictationRecognizer_DictationComplete;
     dictationRecognizer.Dispose();
     interactionManager.isListening = false;
 }
Пример #19
0
 private void DictationComplete(DictationCompletionCause clause)
 {
     if (clause == DictationCompletionCause.TimeoutExceeded)
     {
         Microphone.End(deviceName);
         this.text.text = "BYE!";
         SendMessage("ResetAfterTimeout");
     }
 }
Пример #20
0
 /// <summary>
 /// This event is fired when the recognizer stops, whether from Stop() being called, a timeout occurring, or some other error.
 /// Typically, this will simply return "Complete". In this case, we check to see if the recognizer timed out.
 /// </summary>
 /// <param name="cause">An enumerated reason for the session completing.</param>
 private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
 {
     // If Timeout occurs, the user has been silent for too long.
     // With dictation, the default timeout after a recognition is 20 seconds.
     // The default timeout with initial silence is 5 seconds.
     if (cause == DictationCompletionCause.TimeoutExceeded)
     {
     }
 }
Пример #21
0
        private void DictationRecognizer_InvokeCompletedEvent(DictationCompletionCause cause)
        {
            var handler = DictationComplete;

            if (handler != null)
            {
                handler(cause);
            }
        }
    /// <summary>
    /// 当识别器停止时,该事件将被触发,无论是停止()被调用,超时发生,还是其他错误。
    /// Typically, this will simply return "Complete". In this case, we check to see if the recognizer timed out.
    /// </summary>
    /// <param name="cause">An enumerated reason for the session completing.</param>
    private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
    {
        if (cause == DictationCompletionCause.TimeoutExceeded)
        {
            Microphone.End(deviceName);

            DictationDisplay.text = "链接超时....";
            SendMessage("ResetAfterTimeout");
        }
    }
Пример #23
0
 private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
 {
     // If Timeout occurs, the user has been silent for too long.
     // With dictation, the default timeout after a recognition is 20 seconds.
     // The default timeout with initial silence is 5 seconds.
     if (cause == DictationCompletionCause.TimeoutExceeded)
     {
         TextDisplay.GetComponent <TextMesh>().text = "Dictation has timed out. Please press the record button again.";
     }
 }
    private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
    {
        Debug.Log($"DictationRecognizer_DictationComplete: {cause.ToString()}");

        if (cause != DictationCompletionCause.Complete)
        {
            this.dictationRecognizer.Start();
            Debug.Log("dictationRecognizer.Start");
        }
    }
Пример #25
0
 private void DictationRecognizer_InvokeCompletedEvent(DictationCompletionCause cause)
 {
     /*
      * DictationRecognizer.DictationCompletedDelegate dictationComplete = this.DictationComplete;
      * if (dictationComplete != null)
      * {
      *      dictationComplete(cause);
      * }
      */
 }
Пример #26
0
 /// <summary>
 /// A listener for when the DictationRecognizer had finished recording.
 /// If not because the user turned it off, it will call this class'
 /// StopRecording function and notify the Dictation Listeners of the reason.
 /// </summary>
 /// <param name="cause">The reason that dictation has completed</param>
 private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
 {
     if (cause != DictationCompletionCause.Complete)
     {
         StopRecording();
         foreach (DictationListener dictationListener in DictationListeners)
         {
             dictationListener.NotifyDone(cause);
         }
     }
 }
 /// <summary>
 /// This event is fired when the recognizer stops, whether from Stop() being called, a timeout occurring, or some other error.
 /// Typically, this will simply return "Complete". In this case, we check to see if the recognizer timed out.
 /// </summary>
 /// <param name="cause">An enumerated reason for the session completing.</param>
 private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
 {
     Debug.Log("MICROPHONE COMPLETE: " + cause);
     if (cause == DictationCompletionCause.TimeoutExceeded)
     {
         dictationRecognizer.Start();
         return;
     }
     ;
     PhraseRecognitionSystem.Restart();
 }
Пример #28
0
 private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
 {
     Debug.Log("ended");
     if (cause != DictationCompletionCause.Complete)
     {
         Debug.LogErrorFormat("Dictation completed unsuccessfully: {0}.", cause);
     }
     m_DictationRecognizer.Stop();
     m_DictationRecognizer.Start();
     Debug.Log("Started");
 }
Пример #29
0
    void dictationRecognizer_DictationComplete(DictationCompletionCause completionCause)
    {
        if (completionCause != DictationCompletionCause.Complete)
        {
            Debug.Log("Dictation complete");
        }

        dictationDisplay.text = "";

        keywordRestart();
    }
Пример #30
0
    void dictationRecognizer_DictationComplete(DictationCompletionCause completionCause)
    {
        if (completionCause != DictationCompletionCause.Complete)
        {
            Debug.LogErrorFormat("Dictation completed unsuccessfully: {0}.", completionCause);
        }
        Debug.Log("Dictation complete");

        dictationDisplay.text = "";

        keywordRestart();
    }
Пример #31
0
    /// <summary>
    /// This event is fired when the recognizer stops, whether from Stop() being called, a timeout occurring, or some other error.
    /// Typically, this will simply return "Complete". In this case, we check to see if the recognizer timed out.
    /// </summary>
    /// <param name="cause">An enumerated reason for the session completing.</param>
    private void DictationRecognizer_DictationComplete(DictationCompletionCause cause)
    {
        // If Timeout occurs, the user has been silent for too long.
        // With dictation, the default timeout after a recognition is 20 seconds.
        // The default timeout with initial silence is 5 seconds.
        if (cause == DictationCompletionCause.TimeoutExceeded)
        {
            Microphone.End(deviceName);

            DictationDisplay.text = "Dictation has timed out. Please press the record button again.";
            SendMessage("ResetAfterTimeout");
        }
    }