示例#1
0
        /// <summary>
        /// Initializes a new instance of SpeechRecognizer51
        /// </summary>
        public SpeechRecognizer51()
        {
            recoContext = new SpeechLib.SpSharedRecoContext();

            recoContext.CmdMaxAlternates = 20;
            recoContext.State            = SpeechRecoContextState.SRCS_Disabled;
            ((SpSharedRecoContext)recoContext).Recognition +=
                new _ISpeechRecoContextEvents_RecognitionEventHandler(RecoContext_Recognition);
            ((SpSharedRecoContext)recoContext).FalseRecognition +=
                new _ISpeechRecoContextEvents_FalseRecognitionEventHandler(SpeechRecognizer_FalseRecognition);
            ((SpSharedRecoContext)recoContext).Hypothesis +=
                new _ISpeechRecoContextEvents_HypothesisEventHandler(SpeechRecognizer_Hypothesis);
            ((SpSharedRecoContext)recoContext).AudioLevel +=
                new _ISpeechRecoContextEvents_AudioLevelEventHandler(SpeechRecognizer_AudioLevel);
            ((SpSharedRecoContext)recoContext).EventInterests |= SpeechRecoEvents.SREAudioLevel;

            GetProfiles();
        }
        /// <summary>
        /// Initializes a new instance of SpeechRecognizer51
        /// </summary>
        public SpeechRecognizer51()
        {
            recoContext = new SpeechLib.SpSharedRecoContext();

            recoContext.CmdMaxAlternates = 20;
            recoContext.State = SpeechRecoContextState.SRCS_Disabled;
            ((SpSharedRecoContext)recoContext).Recognition +=
                new _ISpeechRecoContextEvents_RecognitionEventHandler(RecoContext_Recognition);
            ((SpSharedRecoContext)recoContext).FalseRecognition +=
                new _ISpeechRecoContextEvents_FalseRecognitionEventHandler(SpeechRecognizer_FalseRecognition);
            ((SpSharedRecoContext)recoContext).Hypothesis +=
                new _ISpeechRecoContextEvents_HypothesisEventHandler(SpeechRecognizer_Hypothesis);
            ((SpSharedRecoContext)recoContext).AudioLevel +=
                new _ISpeechRecoContextEvents_AudioLevelEventHandler(SpeechRecognizer_AudioLevel);
            ((SpSharedRecoContext)recoContext).EventInterests |= SpeechRecoEvents.SREAudioLevel;

            GetProfiles();
        }