I'm relatively new to both C# and the Microsoft Speech platform, but I am working on a server application that will need to transcribe free dictation. The MS Speech Platform SDK seemed perfect, and works on the server, unless i reference the AppendDictation() method in GrammarBuilder.
I am using the Microsoft Speech Platform SDK 11, and the application works fine if I define a grammar, but the moment I add in AppendDictation(), I am met with this error:
Cannot find grammar referenced by this grammar.
Even this sample from the documentation seems to fail:
GrammarBuilder startStop = new GrammarBuilder();
GrammarBuilder dictation = new GrammarBuilder();
dictation.AppendDictation();
startStop.Append(new SemanticResultKey("StartDictation", new SemanticResultValue("Start Dictation",true)));
startStop.Append(new SemanticResultKey("DictationInput", dictation));
startStop.Append(new SemanticResultKey("StopDictation", new SemanticResultValue("Stop Dictation", false)));
Grammar grammar=new Grammar(startStop);
grammar.Enabled=true;
grammar.Name=" Free-Text Dictation ";
_recognizer.LoadGrammar(grammar);
Oddly, if I change LoadGrammar to LoadGrammarAsync, the grammar loads (or at least the event handler is called), but then the recoginzer fails with this error:
Error: At least one grammar must be loaded before doing a recognition.
I've read that the server version of the platform does not support dictation, but it seems odd that it would ship with a method that just doesn't work. Has anyone managed to get a dictation grammar to work on the server? What am I doing wrong?
Many thanks