Voice recognition in Pt-BR

Asked

Viewed 7,802 times

6

How do I use Speech Recognition when my OS(Windows 8 x64) is in En-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 makes a mistake in the sr.LoadGrammar(g)

An unhandled Exception of type 'System.Platformnotsupportedexception' occurred in System.Speech.dll

Additional information: No recognizer installed."

  • You want to use the recognition in Portuguese or even in English?

  • Yes, in English.

  • 3

    A tip, instead of posting photos of the error, post the code as text, so it makes it easier for people and searchers to find their doubt by the text of the error message.

  • Which version of windows?

  • Windows 8 x64..

1 answer

4

To change the language in the method SpeechRecognizer Theoretically I would have to use it this way:

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

Read more on: https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo(v=vs.110). aspx

However in Windows in Portuguese when Voce accesses this path:

  • Control Panel > Ease of Access > Speech Recognition

And displayed this message:

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

This is because according to this answer microsoft Answers. the Speech recognition is available only for the following languages: english (United States and United Kingdom), french, german, japanese, mandarin (simplified and traditional Chinese) and spaniard, as long as the Windows language is the above, that is, if your Windows language is portuguese, won’t work.

  • By default, as my windows is En, it is already with the CultureInfo in en

  • @Jonathanbarcela updated the reply friend.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.