0

I tried to programe some Speech Recognition app and I found this code:

SpeechRecognitionEngine recognitionEngine = new SpeechRecognitionEngine();

recognitionEngine.SetInputToDefaultAudioDevice();    
recognitionEngine.LoadGrammar(new DictationGrammar());    

RecognitionResult result = recognitionEngine.Recognize(new TimeSpan(0, 0,20));    
foreach (RecognizedWordUnit word in result.Words)     
{     
     Console.Write(word.Text);     
} 

But when I want to Debug it, it shows Error Access Denied HRESULT: 0x80070005 (E_ACCESSDENIED)) on command : recognitionEngine.SetInputToDefaultAudioDevice();

(The reference to System.Speech is set). I looked through many threads already, but I can't find an answer. Should I set somwhere the access to microphone or how can I solve this problem?

Thanks for the answer ;)

MethodMan
  • 18,625
  • 6
  • 34
  • 52
doskarJ
  • 1
  • 1
  • 2
  • 2
    have you thought about trying to do this in a different manner..? perhaps using a grammar engine..? – MethodMan Nov 21 '12 at 17:08
  • 1
    take a look at this article http://msdn.microsoft.com/en-us/magazine/cc163663.aspx and this previous Stackoverflow posting http://stackoverflow.com/questions/5467827/good-speech-recognition-api – MethodMan Nov 21 '12 at 17:09
  • Thanks for advises. That article from DJ Kraze was really usefull. At the end, the solutions was pretty primitive. My Windows7's localization doesn't have installed Speech Recognition Engine, but I counted with it. So my problem is solved, but is there any way to use this code on PC's with no Recognition Engine installed? Propably some "portable" version? =D (I know, maybe this question is stupid)... – doskarJ Nov 25 '12 at 09:44

1 Answers1

0

You need to install speech recognition and text to speech features to your windows. If you are using windows 10, go to start menu and write settings there.

Open settings page.

Open time and language.

Open Region&Language tab.

Add English language US as a language if it doesnt exist.

Click to the English language. Then click to options.

Then under the Speech tab, click download.

Then windows will download the required packages.

After all finishes, restart your system.

smoothumut
  • 3,423
  • 1
  • 25
  • 35