示例#1
0
        //マイクから読み取るため、マイク用のデバイスを指定する
        private SpObjectToken CreateMicrofon()
        {
            SpeechLib.SpObjectTokenCategory objAudioTokenCategory = new SpeechLib.SpObjectTokenCategory();
            objAudioTokenCategory.SetId(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech Server\v11.0\AudioInput", false);
            SpObjectToken objAudioToken = new SpObjectToken();

            objAudioToken.SetId(objAudioTokenCategory.Default, @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech Server\v11.0\AudioInput", false);
            //return null;
            return(objAudioToken);
        }
示例#2
0
        private SpObjectToken CreateMicrofon()
        {
            SpObjectTokenCategory objAudioTokenCategory = new SpObjectTokenCategory();

            objAudioTokenCategory.SetId(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioInput");
            SpObjectToken objAudioToken = new SpObjectToken();

            objAudioToken.SetId(objAudioTokenCategory.Default, @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioInput");
            return(objAudioToken);
        }
示例#3
0
        public void initialize_audio()
        {
            SpObjectTokenCategory category = new SpObjectTokenCategory();

            category.SetId(SpeechStringConstants.SpeechCategoryAudioIn, false);

            SpObjectToken token = new SpObjectToken();

            token.SetId(category.EnumerateTokens().Item(0).Id, "", false);
            //token.SetId(category.Default, "", false);
            context.Recognizer.AudioInput = token;
        }