private static void Main(string[] args) { var vr = new VoiceRecognizer("secret.json"); vr.Start(); Console.ReadKey(); vr.Stop(); Console.ReadKey(); }
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; }
// 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(); }
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(); }
/// <summary> /// Called on initialization /// </summary> private void Awake() { Instance = this; Debug.Log("VoiceRecognizer.Awake"); }
/// <summary> /// Called on initialization /// </summary> private void Awake() { Instance = this; }
/// <summary> /// Called on initialization /// </summary> private void Awake() { // このクラスのインスタンスをシングルトンとして利用する。 Instance = this; }