Good day! I try to write simple speech to text engine use Speech SDK 11. So try to execute test from this example .
So , i just create console app and run code. (with task)
Task speechRecognizer = new Task(DoWork);
speechRecognizer.Start();
speechRecognizer.Wait();
static void DoWork()
{
// Create a new SpeechRecognitionEngine instance.
SpeechRecognitionEngine sre = new SpeechRecognitionEngine();
// Configure the input to the recognizer.
sre.SetInputToWaveFile(@"c:\Test\Colors.wav");
// Create a simple grammar that recognizes "red", "green", or "blue".
Choices colors = new Choices();
colors.Add(new string[] { "red", "green", "blue" });
// Create a GrammarBuilder object and append the Choices object.
GrammarBuilder gb = new GrammarBuilder();
gb.Append(colors);
// Create the Grammar instance and load it into the speech recognition engine.
Grammar g = new Grammar(gb);
sre.LoadGrammar(g);
// Register a handler for the SpeechRecognized event.
sre.SpeechRecognized +=
new EventHandler<SpeechRecognizedEventArgs>(sre_SpeechRecognized);
// Start recognition.
sre.Recognize();
}
But i get this exception:Speech Recognition is not available on this system. SAPI and Speech Recognition engines cannot be found.I try to install SpeechSDK51 ,but have no result.
Can you tell me how to fix this error?
Thank you!
P.S. Error arises at :
// Create a new SpeechRecognitionEngine instance.
SpeechRecognitionEngine sre = new SpeechRecognitionEngine();