6
votes

I have a program with GrammarBuilders and Grammer that is used in a SpeechRecognitionEngine to recognize speech. Can I, rather than recognizing from audio, use the same grammar to recognize a typed command (in a string)? Something like commandGrammar.parse(commandString)?

1
+1 Really interesting idea. What about text-to-speech and then speech-to-text?Jason
It's been about a year since I seriously played with the speech recognition API's (which proved to be primitive at best) so maybe my impression and understanding are just out of date, but isn't the goal of having the speech recognition grammars to allow it to recognize a specific voice? You won't get that from text on its own.M.Babcock
No, the point for this instance is to get logic based input like "do this in 30 seconds". The voice algorithm can handle it fine at the moment, but what if someone types it? There should be a fairly easy way to do this, I think. Speech recognition makes it into text and THEN parses it, right?Christian Stewart

1 Answers

3
votes

You should be able to use SpeechRecognitionEngine.EmulateRecognize which takes a text input in place of audio for speech recognitions.

I am not sure of the intended use, but if this will be used for something like a chat bot that automatically interacts with text input via IM or SMS I think you will find grammars very cumbersome to maintain and restrictive. I would recommend something like Artificial Intelligence Markup Language (AIML) for handling text responses. It is easy to learn and very powerful. Instead of using concise grammars which ASR's require, this language allows you to use wildcards which are much more conducive to text input. There are even some C# open source projects that provide libraries to work with AIML and simplify creation of chat bots.