/// <summary> /// Function that is called when the given SpeechToTextServiceWidget has gotten its last response. If there are no waiting /// SpeechToTextServiceWidgets left, then this function will wrap-up the current comparison session. /// </summary> /// <param name="serviceWidget">The speech-to-text service widget that received a last response</param> void OnSpeechToTextReceivedLastResponse(SpeechToTextServiceWidget serviceWidget) { SmartLogger.Log(DebugFlags.SpeechToTextWidgets, "Response from " + serviceWidget.SpeechToTextServiceString()); m_WaitingSpeechToTextServiceWidgets.Remove(serviceWidget); if (m_WaitingSpeechToTextServiceWidgets.Count == 0) { SmartLogger.Log(DebugFlags.SpeechToTextWidgets, "Responses from everyone"); FinishComparisonSession(); } }
/// <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> void Start() { m_SpeechToTextServiceWidgets = Object.FindObjectOfType(typeof(SpeechToTextServiceWidget)) as SpeechToTextServiceWidget; RegisterSpeechToTextServiceWidgetsCallbacks(); m_SpeechToTextServiceWidgets.OnResult.AddListener(() => GotResults()); }
void Awake() { currentVoiceApi = this; }