public override void StopHandler() { if (grammarRecognizer != null) { grammarRecognizer.Stop(); } }
private void RecognizeSpeech(PhraseRecognizedEventArgs speech) { try { Debug.Log(speech.text); var tokens = speech.text.Split(); switch (tokens[0].ToLower()) { case "hazez": { gm.MovePieceToBoard(NumbersTranslation[tokens[2]], LettersTranslation[tokens[4] + " " + tokens[5]]); if (gm.CheckVictory()) { VictoryUI.SetActive(true); grMove.Stop(); grTake.Stop(); } break; } case "kah": { gm.ReovePieceFromBoard(NumbersTranslation[tokens[2]]); break; } } } catch { } }
private void OnApplicationQuit() { if (recognizer.IsRunning) { recognizer.Stop(); } recognizer.Dispose(); }
// When the application quits. private void OnApplicationQuit() { if (gr != null && gr.IsRunning) { gr.OnPhraseRecognized -= GR_OnPhraseRecognized; gr.Stop(); } }
/// <summary> /// on swapping to T2 of the scenario, stop current Grammar Recognizer, /// dispose of current resources for it (grXML), assign T2 grXML file, /// and start the Grammar Recognizer. /// </summary> public void initGrammarT2() { grammarRec.Stop(); grammarRec.Dispose(); grammarRec = new GrammarRecognizer(Application.streamingAssetsPath + "/XML/grammar_OfficeT2.xml"); grammarRec.OnPhraseRecognized += OnGrammerRecognized; grammarRec.Start(); //Debug.Log("grammar T2 started\nStreaming asset path: " + grammarRec.GrammarFilePath); }
/// <summary> /// Makes sure the GrammarRecognizer is running, then stops it if it is. /// </summary> public void StopGrammarRecognizer() { if (grammarRecognizer != null && grammarRecognizer.IsRunning) { grammarRecognizer.Stop(); } }
public void StopGrammarRecognizer() { Debug.Log("GrammarRecognizer stopping"); if (grammarRecognizer != null && grammarRecognizer.IsRunning) { grammarRecognizer.Stop(); } }
private void OnApplicationQuit() { // Closes down the grammarRecognizer on Quitting application if (grammarRec != null && grammarRec.IsRunning) { grammarRec.OnPhraseRecognized -= grammarRec_OnPhraseRecognized; grammarRec.Stop(); } }
public void QuitGame() { Debug.Log("Quit Game"); if (gr != null && gr.IsRunning) { gr.OnPhraseRecognized -= GR_OnPhraseRecognized; gr.Stop(); } Application.Quit(); }
public void EndGrammer() { if (m_GrammerRecognizer.IsRunning) { Debug.Log("Stopping Grammer Recognizer"); m_GrammerRecognizer.Stop(); } m_GrammerRecognizer.Dispose(); m_GrammerRecognizer = null; Debug.Log("Grammer stopped"); enableUI("EndGrammer"); }