0

It's weird that my program can only recognize Chinese. Btw, I'm in China.

Even if I install the English version of visual c# 2010, it still can just recognize Chinese.

How to change the language setting?

 private void InitializeRecognizerSynthesizer()
    {
        var selectedRecognizer = (from e in SpeechRecognitionEngine.InstalledRecognizers()
                                  where e.Culture.Equals(Thread.CurrentThread.CurrentCulture)
                                  select e).FirstOrDefault();
        recognizer = new SpeechRecognitionEngine(selectedRecognizer);


        recognizer.AudioStateChanged+=new EventHandler<AudioStateChangedEventArgs>(recognizer_AudioStateChanged);
        recognizer.SpeechHypothesized += new EventHandler<SpeechHypothesizedEventArgs>(recognizer_SpeechHypothesized);
        recognizer.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(recognizer_SpeechRecognized);

        synthesizer = new SpeechSynthesizer();
    }

Then I change var selectedRecognizer = (from e in SpeechRecognitionEngine.InstalledRecognizers() where e.Culture.Equals(Thread.CurrentThread.CurrentCulture) select e).FirstOrDefault();

to e.Culture.Equals("en");

But it appears an exception on recognizer = new SpeechRecognitionEngine(selectedRecognizer); saying check to determine if the object is null.

I use microphone as the default audio input device in my control panel.

I have tried this simplest code in http://msdn.microsoft.com/en-us/library/ms554259.aspx just now. An exception also occurs warning no such culture identifier in sentence: SpeechRecognitionEngine recognizer = new SpeechRecognitionEngine( new System.Globalization.CultureInfo("en-US")))

user1866046
  • 25
  • 1
  • 5
  • possible duplicate of [Change the language of Speech Recognition Engine library](http://stackoverflow.com/questions/13981294/change-the-language-of-speech-recognition-engine-library) – Cody Gray - on strike Apr 16 '13 at 05:13
  • hi, but I already create the SpeechRecognitionEngine class with seletedRecognizer. How to overload the cultureinfo. I've tried to add the sentence mentioned in that post, but failed. – user1866046 Apr 16 '13 at 06:16

0 Answers0