public MainForm(User user) { heaer = new UcommHearerOne(RecognitionEvent, FalseRecognitionEvent); SetHearerEvent(); this.user = user; this.speaker = new UcommSpeaker(); InitializeComponent(); mainCameraCapture = Cv.CreateCameraCapture(0); Task.Factory.StartNew( mainCameraLoop ); lblUserGuide.Parent = pbxMainCamera; setFormText(); InitializeVoiceMemo(); }
private void RecognitionEvent(int streamNumber, object streamPosition, SpeechLib.SpeechRecognitionType srt, SpeechLib.ISpeechRecoResult isr) { string strText = isr.PhraseInfo.GetText(0, -1, true); if (this.heaer.GetType().Name == "UcommHearerOne") { if (strText == "検索") { Console.WriteLine("One : " + strText); this.heaer = new UcommHearerTwoSearch(RecognitionEvent, FalseRecognitionEvent); } else if (strText == "メモ") { Console.WriteLine("One : " + strText); this.heaer = new UcommHearerTwoMemo(RecognitionEvent, FalseRecognitionEvent); } else if (strText == "終了") { Application.Exit(); } } else if (this.heaer.GetType().Name == "UcommHearerTwoSearch") { Console.WriteLine("TwoSearch : " + strText); if (strText == "検索") { } else if (strText == "履歴") { } else if (strText == "戻る") { this.heaer = new UcommHearerOne(RecognitionEvent, FalseRecognitionEvent); } } else if (this.heaer.GetType().Name == "UcommHearerTwoMemo") { Console.WriteLine("TwoMemo"); if (strText == "登録") { } else if (strText == "一覧") { } else if (strText == "登録") { } else if (strText == "戻る") { this.heaer = new UcommHearerOne(RecognitionEvent, FalseRecognitionEvent); } } }