Exemple #1
0
        private static void Main(string[] args)
        {
            var vr = new VoiceRecognizer("secret.json");

            vr.Start();
            Console.ReadKey();

            vr.Stop();
            Console.ReadKey();
        }
Exemple #2
0
        private void Engine_RecognizeCompleted(object sender, SpeechRecognizedEventArgs e)
        {
            wr = new VoiceRecognizer();

            FieldInfo f = e.Result.Audio.GetType().GetField("_rawAudioData", BindingFlags.Instance | BindingFlags.NonPublic);

            string message = wr.Recognize((byte[])f.GetValue(e.Result.Audio));

            richTextBox1.Text += " " + message;
        }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        //test code
        //UpdateInstructions(new List<string>() { "Turn on the tosti iron", "Check ingredients", "Spread butter on your bread", "Scrape the cheese", "Put cheese and ham on top of the butter",
        //"Place the bread in the sandwich iron", "Wait 6 minutes and you are done"});
        //end test code

        // Register buttons
        transform.Find("BtnNextFrame").GetComponent <ControlMenuButton>().OnClick     += StepForward;
        transform.Find("BtnPreviousFrame").GetComponent <ControlMenuButton>().OnClick += StepBackward;

        _voiceRecognizer = Instantiate(VoiceRecognizerPrefab).GetComponent <VoiceRecognizer>();
        _voiceRecognizer.RegisterKeyword("next");
        _voiceRecognizer.RegisterKeyword("previous");

        _voiceRecognizer.OnDictionaryReset += RegisterVoiceEvent;
        RegisterVoiceEvent();
    }
Exemple #4
0
    private void Awake()
    {
        VoiceOn = true;

        var cursor = Instantiate(CursorPrefab);

        cursor.transform.parent = Camera.main.transform;

        _guidance = Instantiate(GuidancePrefab).GetComponent <Guidance>();
        _guidance.transform.parent = Camera.main.transform;
        _guidance.GetComponent <Guidance>().SetInstruction("Say \"Menu\" to open the recipe menu");

        _voiceRecognizer = Instantiate(VoiceRecognizerPrefab).GetComponent <VoiceRecognizer>();
        _voiceRecognizer.RegisterKeyword("menu");
        _voiceRecognizer.RegisterKeyword("set timer");
        _voiceRecognizer.RegisterKeyword("add timer");

        _voiceRecognizer.OnDictionaryReset += RegisterVoiceEvent;
        RegisterVoiceEvent();
    }
Exemple #5
0
 /// <summary>
 /// Called on initialization
 /// </summary>
 private void Awake()
 {
     Instance = this;
     Debug.Log("VoiceRecognizer.Awake");
 }
Exemple #6
0
 /// <summary>
 /// Called on initialization
 /// </summary>
 private void Awake()
 {
     Instance = this;
 }
Exemple #7
0
 /// <summary>
 /// Called on initialization
 /// </summary>
 private void Awake()
 {
     // このクラスのインスタンスをシングルトンとして利用する。
     Instance = this;
 }