コード例 #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);
        }