Example #1
0
 /// <summary>
 /// If dictation manager encounters error, end recording.
 /// </summary>
 public void OnDictationError(DictationEventData eventData)
 {
     isRecording = false; // set recording status to false
     dictationOutputText.color = Color.red;
     renderer.material.color   = Color.red;
     StartCoroutine(DictationInputManager.StopRecording()); // end recording
 }
 public void OnDictationResult(DictationEventData eventData)
 {
     Debug.Log(eventData.DictationResult);
     StartCoroutine(DictationInputManager.StopRecording());
     StartCoroutine(SubmitRequestToLuis(eventData.DictationResult));
     eventData.Use();
 }
Example #3
0
 public void OnDictationError(DictationEventData eventData)
 {
     speechToTextOutput.text  = eventData.DictationResult;
     speechToTextOutput.color = Color.white;
     isRecording = false;
     StartCoroutine(DictationInputManager.StopRecording());
 }
Example #4
0
 private void ToNextQuestion_ButtonClick(GameObject obj)
 {
     m_lastTimeChangedQuestion = Time.time;
     m_currentQuestionID++;
     while ((Dictionary[m_currentQuestionID].NavigationFunction != null) && !Dictionary[m_currentQuestionID].NavigationFunction().ShouldSelect)
     {
         if (m_currentQuestionID == QuestionID.HowIsBodyPartFeelin)
         {
             if (!m_isReportingMode)
             {
                 OnStoreSectionTwo_ButtonClick(null);
             }
             else
             {
                 Exit();
             }
             return;
         }
         m_currentQuestionID++;
     }
     SetCurrentQuestion(m_currentQuestionID, !m_isReportingMode);
     if (DictationInputManager.IsListening)
     {
         StartCoroutine(DictationInputManager.StopRecording());
     }
 }
Example #5
0
 void IDictationHandler.OnDictationError(DictationEventData eventData)
 {
     isRecording        = false;
     speechToTextOutput = eventData.DictationResult;
     Debug.LogError(eventData.DictationResult);
     StartCoroutine(DictationInputManager.StopRecording());
 }
Example #6
0
 /// <summary>
 /// Destroy unmanaged memory links.
 /// </summary>
 protected override void OnDestroy()
 {
     if (IsMicrophoneActive())
     {
         StartCoroutine(DictationInputManager.StopRecording());
     }
     base.OnDestroy();
 }
 public void StopListening()
 {
     if (isRecording)
     {
         isRecording      = false;
         TextOutput.color = Color.white;
         StartCoroutine(DictationInputManager.StopRecording());
     }
 }
Example #8
0
    /// <summary>
    /// When dictation is complete, end recording.
    /// </summary>
    public void OnDictationComplete(DictationEventData eventData)
    {
        dictationOutputText.text = eventData.DictationResult;  // record result

        isRecording = false;                                   // recording status false
        StartCoroutine(DictationInputManager.StopRecording()); // end recording
        renderer.material.color   = Color.green;
        dictationOutputText.color = Color.green;
    }
Example #9
0
 /// <summary>
 /// Close the keyboard.
 /// (Clears all event subscriptions.)
 /// </summary>
 public void Close()
 {
     if (IsMicrophoneActive())
     {
         StartCoroutine(DictationInputManager.StopRecording());
     }
     SetMicrophoneDefault();
     OnClosed(this, EventArgs.Empty);
     gameObject.SetActive(false);
 }
Example #10
0
 public void OnDictationError(DictationEventData eventData)
 {
     isRecording = false;
     speechToTextOutput.color = Color.red;
     buttonRenderer.enabled   = true;
     recordLight.SetActive(false);
     speechToTextOutput.text = eventData.DictationResult;
     Debug.LogError(eventData.DictationResult);
     StartCoroutine(DictationInputManager.StopRecording());
 }
Example #11
0
 public void OnInputClicked(InputClickedEventData eventData)
 {
     if (!DictationInputManager.IsListening)
     {
         StartCoroutine(DictationInputManager.StartRecording());
     }
     else
     {
         StartCoroutine(DictationInputManager.StopRecording());
     }
 }
Example #12
0
 private void ToggleRecording()
 {
     if (isRecording)
     {
         isRecording = false;
         StartCoroutine(DictationInputManager.StopRecording());
     }
     else
     {
         isRecording = true;
         StartCoroutine(DictationInputManager.StartRecording(listener, autoSilenceTimeout, recordingTime));
     }
 }
Example #13
0
 private void ToggleRecording()
 {
     StartCoroutine(DictationInputManager.StopRecording());
     Debug.Log("stop recording");
     speechToTextOutput.color        = Color.white;
     MovieScript.main.scoreText.text = MovieScript.main.scoreQuote(speechToTextOutput.text).ToString();
     StartCoroutine(DictationInputManager.StartRecording(initialSilenceTimeout, autoSilenceTimeout, recordingTime));
     MovieScript.main.nextQuote();
     speechToTextOutput.text  = "...";
     speechToTextOutput.color = Color.green;
     recordLight.SetActive(true);
     buttonRenderer.enabled = false;
     Debug.LogWarning("start recording");
 }
Example #14
0
 private void ToPreviousQuestion_ButtonClick(GameObject obj)
 {
     m_lastTimeChangedQuestion = Time.time;
     m_currentQuestionID--;
     while ((Dictionary[m_currentQuestionID].NavigationFunction != null) && !Dictionary[m_currentQuestionID].NavigationFunction().ShouldSelect)
     {
         m_currentQuestionID--;
     }
     SetCurrentQuestion(m_currentQuestionID, !m_isReportingMode);
     if (DictationInputManager.IsListening)
     {
         StartCoroutine(DictationInputManager.StopRecording());
     }
 }
Example #15
0
 private void Recording()
 {
     if (isRecording)
     {
         isRecording = false;
         StartCoroutine(DictationInputManager.StopRecording());
         speechToTextOutput.color = Color.white;
     }
     else
     {
         isRecording = true;
         StartCoroutine(DictationInputManager.StartRecording(null, 5f, 20f, 10));
         speechToTextOutput.color = Color.red;
     }
 }
Example #16
0
 /// <summary>
 /// Toggle recording (begin if not recording, end if still recording)
 /// </summary>
 private void ToggleRecording()
 {
     if (isRecording)
     {
         isRecording = false;
         StartCoroutine(DictationInputManager.StopRecording());
         Debug.LogWarning("recording stopped");
         dictationOutputText.color = Color.green;
     }
     else
     {
         isRecording = true;                                               // set recording status to true
         StartCoroutine(DictationInputManager.StartRecording(5f, 2f, 30)); // begin recording
         dictationOutputText.color = Color.red;
         renderer.material.color   = Color.red;
     }
 }
Example #17
0
    //public void OnInputClicked(InputClickedEventData eventData)
    //{
    //    ToggleRecording();
    //}

    public void ToggleRecording()
    {
        if (isRecording)
        {
            isRecording = false;
            StartCoroutine(DictationInputManager.StopRecording());
            TextOutput.color = Color.white;
        }
        else
        {
            isRecording = true;
            StartCoroutine(DictationInputManager.StartRecording(
                               this.gameObject));
            TextOutput.color = Color.green;
            TextOutput.text  = "...";
        }
    }
Example #18
0
 public void ToggleRecording()
 {
     if (isRecording)
     {
         isRecording = false;
         StartCoroutine(DictationInputManager.StopRecording());
         speechToTextOutput.color = Color.white;
         buttonRenderer.enabled   = true;
         recordLight.SetActive(false);
     }
     else
     {
         isRecording = true;
         StartCoroutine(DictationInputManager.StartRecording(initialSilenceTimeout, autoSilenceTimeout, recordingTime));
         speechToTextOutput.color = Color.green;
         recordLight.SetActive(true);
         buttonRenderer.enabled = false;
     }
 }
Example #19
0
 public void ToggleRecording()
 {
     if (isRecording)
     {
         isRecording = false;
         StartCoroutine(DictationInputManager.StopRecording());
         speechToTextOutput.color = Color.white;
         SetDictationState(false);
         //ButtonRenderer.enabled = true;
     }
     else
     {
         isRecording = true;
         StartCoroutine(DictationInputManager.StartRecording(
                            gameObject,
                            initialSilenceTimeout,
                            autoSilenceTimeout,
                            recordingTime));
         speechToTextOutput.color = Color.green;
         SetDictationState(true);
         //ButtonRenderer.enabled = false;
     }
 }
 public void StopListening()
 {
     isRecording = false;
     StartCoroutine(DictationInputManager.StopRecording());
     PhraseRecognitionSystem.Restart();
 }
Example #21
0
 /// <summary>
 /// Terminate dictation mode.
 /// </summary>
 public void EndDictation()
 {
     StartCoroutine(DictationInputManager.StopRecording());
     SetMicrophoneDefault();
 }