Speech to text enabling in unity not working

73 views Asked by At

I am using unity 2018.1.0f2 and windows 10. Below is the code.

using System.Collections;

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Windows.Speech;
public class Dinovoice : MonoBehaviour {
    KeywordRecognizer KeywordRecognizerObj;
    void Start () {
      string[] keywords_array={"Jump","Run"};
      KeywordRecognizerObj= new KeywordRecognizer(keywords_array);
      KeywordRecognizerObj.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized;
      KeywordRecognizerObj.Start();
      Debug.Log("Started");
    }
    void Update() {

    }
    private void KeywordRecognizer_OnPhraseRecognized(PhraseRecognizedEventArgs args)
    {
       Debug.Log("Ended");
   }
}

When I run from unity Started is getting printed.Ended is not getting printed at all when I speak.I am using unity with wikitude. I am adding this script to my prefab.Can you please help me out.Is there any setting I am missing?

Thanks

0

There are 0 answers