コード例 #1
0
        public SpeechConversation(SpeechSynthesizer speechSynthesizer = null, SpeechRecognitionEngine speechRecognition = null)
        {
            SessionStorage = new SessionStorage();
            if(speechSynthesizer==null)
            {
                speechSynthesizer = new SpeechSynthesizer();
                speechSynthesizer.SetOutputToDefaultAudioDevice();
            }
            _speechSynthesizer = speechSynthesizer;
            if(speechRecognition==null)
            {
                speechRecognition = new SpeechRecognitionEngine(
                    new System.Globalization.CultureInfo("en-US")
                );
                // Create a default dictation grammar.
                DictationGrammar defaultDictationGrammar = new DictationGrammar();
                defaultDictationGrammar.Name = "default dictation";
                defaultDictationGrammar.Enabled = true;
                speechRecognition.LoadGrammar(defaultDictationGrammar);
                // Create the spelling dictation grammar.
                DictationGrammar spellingDictationGrammar = new DictationGrammar("grammar:dictation#spelling");
                spellingDictationGrammar.Name = "spelling dictation";
                spellingDictationGrammar.Enabled = true;
                speechRecognition.LoadGrammar(spellingDictationGrammar);

                // Configure input to the speech recognizer.
                speechRecognition.SetInputToDefaultAudioDevice();
            }
            _speechRecognition = speechRecognition;
        }
コード例 #2
0
        public ConsoleSpeechChatSession()
        {
            SessionStorage = new SessionStorage();

            SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();
            speechSynthesizer.SetOutputToDefaultAudioDevice();
            _speechSynthesizer = speechSynthesizer;
        }
コード例 #3
0
 public ConsoleSpeechChatSession(SpeechSynthesizer speechSynthesizer)
 {
     SessionStorage = new SessionStorage();
     if (speechSynthesizer == null)
     {
         speechSynthesizer = new SpeechSynthesizer();
         speechSynthesizer.SetOutputToDefaultAudioDevice();
     }
     _speechSynthesizer = speechSynthesizer;
 }
コード例 #4
0
 public ConsoleChatSession()
 {
     SessionStorage = new SessionStorage();
 }
コード例 #5
0
 public LyncConversation(Conversation Conversation)
 {
     _conversation = Conversation;
     SessionStorage = new SessionStorage();
 }
コード例 #6
0
 public LyncConversation(Conversation Conversation)
 {
     _conversation  = Conversation;
     SessionStorage = new SessionStorage();
 }
コード例 #7
0
 public ConsoleChatSession()
 {
     SessionStorage = new SessionStorage();
 }