コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: rusith/AISA
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Start AISA Command Recognition
            try
            {
                AISAHandler.Initialize(() =>
                {
                    Speech.Activate();
                    AskSheet.Visibility   = Visibility.Hidden;
                    Spinner.Visibility    = Visibility.Visible;
                    Hypothesis.Visibility = Visibility.Visible;
                },
                                       () =>
                {
                    Speech.Deactivate();
                }, HandleResult);
            }
            catch (Exception) { }

            AISAHandler.Start();

            //Set advanced result controllers
            ViewControllerConnector.Connect          += ConnectionHandler;
            ViewControllerConnector.None             += NoneHandler;
            ViewControllerConnector.ChangeHypothesis += ChangeHypothesisHandler;
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: rusith/AISA
        private void StartRecognition()
        {
            AudioHandler.Start();
            Speech.Activate();

            var rec = new Recognizer(() => { Speech.Deactivate(); }, HandleResult);
        }