コード例 #1
0
        // CONVERSATION

        public void frmMain_Load(object sender, EventArgs e)
        {
            R_Speech = new R_Lib.R_Speech(FormControls.getForm <frmMain>().rt_Convo);

            #region setup db connection

            //System.IO.File.Delete(Application.StartupPath + @"\rioDB.sdf"); //Testing script
            #endregion setup db connection

            R_Speech.loadSystemVocabs(); // load rio default commands
            // loadShellGrammar
            ActionResult shellGrammar = R_Speech.loadShellGrammar();
            if (shellGrammar.success)
            {
                if (shellGrammar.msg == "AddCommand")
                {
                    frmCustom cust = new frmCustom();
                    cust.isShown = true;
                    cust.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show(shellGrammar.msg);
            }
            //loadDictationGrammar();
            //R_Speech.R_SpeakAsync("Dictation grammars loaded");

            // load default microphone
            R_Speech.R_recognizer.SetInputToDefaultAudioDevice();
            // sets the program to interpret multiple commands
            R_Speech.R_recognizer.RecognizeAsync(RecognizeMode.Multiple);
        }
コード例 #2
0
ファイル: UICommands.cs プロジェクト: ArdenMendoza/RIO
        public void UpdateCommands()
        {
            R_Speech.SpeakAsync("This may take a few seconds");
            custom = new frmCustom();
            custom.CustomSave();
            try
            {
                if (R_Speech.R_shellcommandgrammar != null)
                {
                    R_Speech.R_recognizer.UnloadGrammar(R_Speech.R_shellcommandgrammar);
                }
                R_Speech.loadShellGrammar();
            }
            catch (Exception ex) { R_Speech.SpeakAsync("Error while updating commands(UpdateCommands())\r\n" + ex.Message); }

            R_Speech.SpeakAsync("All commands updated");
        }