コード例 #1
0
//This is related to the Speech to Text
    void Update()
    {
        if (listening)
        {
            //Verify if the 2 condition to stop listening are there
            if (cooldownSTT >= limitSTT && !String.IsNullOrEmpty(savedLineSTT))
            {
                STTstreamer.StopRecording();
                string tempString = lineSTT.Trim(Environment.NewLine.ToCharArray());
                associatedLogControl.LogText(tempString, new Color(252f / 255, 161f / 255, 157f / 255));
                SendLineAssistant(tempString);
                savedLineSTT      = "";
                lineSTT           = "";
                listening         = false;
                finishedListening = true;
            }//Add 1 (time period) if the 2 texts are equal
            if (lineSTT == savedLineSTT)
            {
                cooldownSTT += Time.deltaTime;
            }
            else//Otherwise, reset time and copy the line from the STT to the line saved.
            {
                cooldownSTT  = 0f;
                savedLineSTT = lineSTT;
            }
            if (!STTstreamer.Active && cooldownSTT > 2f)
            {
                STTstreamer = new ExampleStreaming();
                STTstreamer.SetServiceFromWrapper(stt);
                STTstreamer.StartRecording();
                cooldownSTT = 0f;
            }
        }
    }
コード例 #2
0
ファイル: NotesController.cs プロジェクト: NPreda/GenericUI
 private void inputText(UIButton button)
 {
     if (inputField.text != "")
     {
         logControl.LogText(inputField.text);
         inputField.text = "";
     }
 }
コード例 #3
0
ファイル: AddLog.cs プロジェクト: alexander-kurakin/5yearsapp
 public void LogText()
 {
     logControl.LogText(myYearText.text + ": \n" + myInputText.text);
 }
コード例 #4
0
ファイル: RunLog.cs プロジェクト: maoweiming/IBMCC-Avatar
 public void LogText()
 {
     logControl.LogText(myText, myColour);
 }