What could be wrong in the code? Does not recognize the voice

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Speech.Recognition; namespace Speech { public partial class Form1 : Form { SpeechRecognitionEngine recorder = new SpeechRecognitionEngine(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Choices choices = new Choices(); choices.Add(new string[] { "one", "two" }); GrammarBuilder gb = new GrammarBuilder(); gb.Append(choices); Grammar grammar = new Grammar(gb); recorder.LoadGrammarAsync(grammar); recorder.SetInputToDefaultAudioDevice(); recorder.SpeechRecognized += recorder_SpeechRecognized; } void recorder_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { if (e.Result.Text == "one") MessageBox.Show("You used one"); else if (e.Result.Text == "two") textBox1.Text += "You used two"; } private void Enable_Click(object sender, EventArgs e) { recorder.RecognizeAsync(RecognizeMode.Multiple); Disable.Enabled = true; } private void Disable_Click(object sender, EventArgs e) { recorder.RecognizeAsyncStop(); Disable.Enabled = false; } } } 
  • you should indicate the error your code generates - michael_best
  • No error, just does not recognize the voice - user
  • You have a Russian Windows, and try to recognize the English. the words. When creating a grammar, then specify the target language. - Bulson
  • No, Windows in English - user

0