deepender singla

deepender singla

  • NA
  • 113
  • 76.5k

Getting error like are you missing an assembly reference in my program

Jul 2 2011 2:42 AM
hello

i am using this code in .net framework 3.5 , for creating a grammar using visual studio 2010 professional in win 7 but i am getting errors like 
The type or namespace name 'Speech' does not exist in system (are you missing a using directive or an assembly reference.

The type or namespace name 'SpeechRecognitionType' could not be found (are you missing a using directive or an assembly reference,

similarly others like type linq does not exist are you an missing an assembly refernce. plz help i will be very much thankfull to you i an a newbie 

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<SpeechRecognizedEventArgs>(rec_SpeechRecognized);
            sr
.LoadGrammar(wordsList);

       
}

       
void rec_SpeechRecognized(object sender, RecognitionEventArgs e)
       
{
           
MessageBox.Show(e.Result.Text);
       
}
   
}
}

Answers (2)