Example #1
0
        public clsEngineMS(ENGINE_MODE mode, string gramma_file_path)
        {
            try
            {
                // create the engine
                g_engine = engine_ms_create(ENG_MS_CULTURE);

                g_mode = mode;

                // hook to events
                g_engine.AudioLevelUpdated += new EventHandler <AudioLevelUpdatedEventArgs>(engine_ms_audiolevel_updated);
                g_engine.SpeechRecognized  += new EventHandler <SpeechRecognizedEventArgs>(engine_ms_speech_recognized);

                // load dictionary
                if (File.Exists(gramma_file_path))
                {
                    engine_ms_load_gramma(gramma_file_path, MS_GRAMMA.MS_CHOICE);
                }
                else
                {
                    Program.log("Gramma file not exist", ERR_LEVEL.ERR_FATAL);
                }
            }
            catch (Exception ex)
            {
                Program.log(ex.Message, ERR_LEVEL.ERR_WARN);
            }
        }
Example #2
0
        private bool engine_init(ENGINE_MODE mode, string gramma_file_path)
        {
            bool result = false;

            Program.log("Recognize Engine Init..");
            get_available_engine();

            // only ms engine is available now
            g_engine = new clsEngineMS(mode, gramma_file_path);

            try
            {
            }
            catch (Exception ex)
            {
                Program.log(ex.Message, ERR_LEVEL.ERR_FATAL);
            }

            return(result);
        }
Example #3
0
 private bool engine_init(ENGINE_MODE mode)
 {
     return(engine_init(mode, DEBUG_ENG_MS_GRAMMA_FILE));
 }