Voice recognition in Pt-BR [duplicate]

6

How to use Speech Recognition when my OS (Windows 8 x64) is in Pt-BR? I want to use commands in English.

I'm using the following code:

private void Form1_Load(object sender, EventArgs e)
        {
            SpeechRecognizer sr = new SpeechRecognizer();
            Choices commands = new Choices();
            commands.Add("hi", "test");

            GrammarBuilder gb = new GrammarBuilder();
            gb.Append(commands);

            Grammar g = new Grammar(gb);

            sr.LoadGrammar(g);

            sr.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(sr_SpeechRecognized);


        }

        void sr_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            textBox1.Text = e.Result.Text;
        }

But it gives error in sr.LoadGrammar(g)

  An unhandled exception of type 'System.PlatformNotSupportedException' occurred in System.Speech.dll

     

Additional information: No installed recognizer.

    
asked by anonymous 03.09.2015 / 20:04

1 answer

4

To change the language in the SpeechRecognizer method you theoretically would have to use this way:

private void Form1_Load(object sender, EventArgs e)
        {
            SpeechRecognizer sr = new SpeechRecognizer(new CultureInfo("pt-BR"));

Read more at: link

However in Windows in Portuguese when you access this path:

  • Control Panel > Ease of Access > Speech Recognition

And this message is displayed:

  

Windows Speech recognition is not available for your current display language.

This is because according to this answer answers.microsoft

Speech Recognition is available only for the following languages: English French , German , Japanese , Mandarin since the language of Windows is the ones mentioned, that is, if the language of your Windows is Portuguese , it will not work.

    
03.09.2015 / 21:08