Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the language of Speech Recognition Engine library

I am working on a program (in C#) to recognize voice commands from the user and execute in the PC, i.e. the user says "start menu" and the PC opens the start menu.

I have find a cool library: SpeechRecognitionEngine for the speech recognition, the problem is that I need to recognize spanish language too, is there any way to change the language?

like image 874
Fernando Santiago Avatar asked Dec 20 '12 22:12

Fernando Santiago


1 Answers

You can use the SpeechRecognitionEngine(CultureInfo) overload.

var speechRec = new SpeechRecognitionEngine(new CultureInfo("es-ES")));

This assumes that the user has the Spanish culture installed, otherwise an ArgumentException will be thrown. The SpeechRecognitionEngine class implements IDisposable, so it's a good idea to call speechRec.Dispose() when you're done, or use it in a using statement.

like image 145
keyboardP Avatar answered Oct 08 '22 23:10

keyboardP