示例#1
0
 public override void StopHandler()
 {
     if (grammarRecognizer != null)
     {
         grammarRecognizer.Stop();
     }
 }
示例#2
0
    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();
     }
 }
示例#5
0
    /// <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);
    }
示例#6
0
 /// <summary>
 /// Makes sure the GrammarRecognizer is running, then stops it if it is.
 /// </summary>
 public void StopGrammarRecognizer()
 {
     if (grammarRecognizer != null && grammarRecognizer.IsRunning)
     {
         grammarRecognizer.Stop();
     }
 }
示例#7
0
 public void StopGrammarRecognizer()
 {
     Debug.Log("GrammarRecognizer stopping");
     if (grammarRecognizer != null && grammarRecognizer.IsRunning)
     {
         grammarRecognizer.Stop();
     }
 }
示例#8
0
 private void OnApplicationQuit()
 {
     // Closes down the grammarRecognizer on Quitting application
     if (grammarRec != null && grammarRec.IsRunning)
     {
         grammarRec.OnPhraseRecognized -= grammarRec_OnPhraseRecognized;
         grammarRec.Stop();
     }
 }
示例#9
0
 public void QuitGame()
 {
     Debug.Log("Quit Game");
     if (gr != null && gr.IsRunning)
     {
         gr.OnPhraseRecognized -= GR_OnPhraseRecognized;
         gr.Stop();
     }
     Application.Quit();
 }
示例#10
0
    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");
    }