Thursday, May 24, 2007

How many TOPLEVEL="Active" rules can I have?

Empirical Answer: 256

When I put more than 256 rules in a grammar and try to load it, I get a System.OutOfMemoryException: Insufficient memory to continue the execution of the program. at SpeechLib.ISpeechRecoGrammar.CmdSetRuleIdState(Int32 RuleId, SpeechRuleState State)at SwitchSapi.Form1.OnLoad(EventArgs e)

(Sapi 5.1)

The good news is you can make a larger grammar, you just can't have more rules than that that are top level.

Blah Blah Blah...

In the speech properties panel (Start - control panel - speech - speech recognition tab - language) you may have the options Microsoft English Recognizer v5.1 and the SAPI developer sample engine.

I use the Microsoft English Recognizer v5.1, but occasionally it gets accidentally switched. I think it has caused the following behaviour:

* actually outputting "blah blah blah", much to my confusion (because it wasn't in the grammar)

* Suddenly recognizing much faster and more poorly

If you are experiencing any of these things, check your speech properties.