Note that there are some explanatory texts on larger screens.

plurals
  1. PORunning a basic speech recognition program with windows 7 in c# VS 2010, it compiles, but it does not run
    text
    copied!<p>I recently tried writing a basic speech recognition using C# (WinFormsApp) in VS 2010 on a Windows 7 Dell computer. I was able to make it work using the basic examples from microsoft (http://msdn.microsoft.com/en-us/magazine/cc163663.aspx#S5) and from forums like this one. However, I needed to change computers and now I am trying to replicate this on a Lenovo computer with the same specs. It does not work, in fact, the speech recognition keeps interfering with the program running and when I changed to the <code>SpeechRecognitionEngine</code> it still doesn't run. I am able to compile with no error, but I do not see a result, that is, the MessageBox showing the <code>e.Result.Text</code>.</p> <p>My code is below:</p> <pre><code>using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Speech.Recognition; using System.Threading; namespace SpeechRecogTest { public partial class Form1 : Form { SpeechRecognitionEngine sr = new SpeechRecognitionEngine(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { //Create grammar Choices words = new Choices(); words.Add("Hi"); words.Add("No"); words.Add("Yes"); Grammar wordsList = new Grammar(new GrammarBuilder(words)); wordsList.SpeechRecognized += new EventHandler&lt;SpeechRecognizedEventArgs&gt;(rec_SpeechRecognized); sr.LoadGrammar(wordsList); } void rec_SpeechRecognized(object sender, RecognitionEventArgs e) { MessageBox.Show(e.Result.Text); } } } </code></pre> <p>I would really appreciate all your help. I am pretty sure I have installed all the SDKs, including SAPI 5.1, Windows SDK v7.0 and v7.1, I have also included the speech libraries for both COM and NET, and I built a synthesizer that works.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload