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;
        }
        public ConsoleSpeechChatSession()
        {
            SessionStorage = new SessionStorage();

            SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();
            speechSynthesizer.SetOutputToDefaultAudioDevice();
            _speechSynthesizer = speechSynthesizer;
        }
 public ConsoleSpeechChatSession(SpeechSynthesizer speechSynthesizer)
 {
     SessionStorage = new SessionStorage();
     if (speechSynthesizer == null)
     {
         speechSynthesizer = new SpeechSynthesizer();
         speechSynthesizer.SetOutputToDefaultAudioDevice();
     }
     _speechSynthesizer = speechSynthesizer;
 }
 public ConsoleChatSession()
 {
     SessionStorage = new SessionStorage();
 }
Example #5
0
 public LyncConversation(Conversation Conversation)
 {
     _conversation = Conversation;
     SessionStorage = new SessionStorage();
 }
 public LyncConversation(Conversation Conversation)
 {
     _conversation  = Conversation;
     SessionStorage = new SessionStorage();
 }
 public ConsoleChatSession()
 {
     SessionStorage = new SessionStorage();
 }