Assets/SpeechToText/Scripts/SpeechToTextWidgets/SpeechToTextServiceWidget.cs
/// <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>
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.
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 .
void OnSpeechToTextError(string text)
        {
            SmartLogger.LogError(DebugFlags.SpeechToTextWidgets, SpeechToTextServiceString() + " error: " + text);
            if (m_WillDisplayReceivedResults)
            {
                m_PreviousFinalResults += "[Error: " + text + "] ";
                m_ResultsTextUI.color = m_ErrorTextColor;
                m_ResultsTextUI.text = m_PreviousFinalResults;
                if (m_WaitingForLastFinalResultOfSession)
                {
                    m_WaitingForLastFinalResultOfSession = false;
                    if (m_OnReceivedLastResponse != null)
                    {
                        m_OnReceivedLastResponse(this);
                    }
                }
            }
        }
void OnSpeechToTextError ( string text ) { SmartLogger . LogError ( DebugFlags . SpeechToTextWidgets , SpeechToTextServiceString ( ) + " " + text ) ; if ( m_WillDisplayReceivedResults ) { m_PreviousFinalResults += " " + text + " " ; m_ResultsTextUI . color = m_ErrorTextColor ; m_ResultsTextUI . text = m_PreviousFinalResults ; if ( m_WaitingForLastFinalResultOfSession ) { m_WaitingForLastFinalResultOfSession = false ; if ( m_OnReceivedLastResponse != null ) { m_OnReceivedLastResponse ( this ) ; } } } }
Function that is called when an error occurs.
Function that is called when an error occurs .
text
string
The error text
The error text