예제 #1
0
 /// <summary>
 /// Function that is called when an error occurs. If this object is waiting for
 /// a last response, then this error is treated as the last "result" of the current session.
 /// </summary>
 /// <param name="text">The error text</param>
 void OnSpeechToTextError(string text)
 {
     SmartLogger.LogError(DebugFlags.SpeechToTextWidgets, SpeechToTextServiceString() + " error: " + text);
     if (m_WillDisplayReceivedResults)
     {
         m_PreviousFinalResults += "[Error: " + text + "] ";
         results = m_PreviousFinalResults;
         if (m_WaitingForLastFinalResultOfSession)
         {
             m_WaitingForLastFinalResultOfSession = false;
             if (m_OnReceivedLastResponse != null)
             {
                 m_OnReceivedLastResponse(this);
             }
         }
     }
 }
 /// <summary>
 /// Initialization function called on the frame when the script is enabled just before any of the Update
 /// methods is called the first time.
 /// </summary>
 protected override void Start()
 {
     base.Start();
     SmartLogger.LogError(DebugFlags.GoogleStreamingSpeechToText, "This service is only supported on Windows.");
 }