Discussion:
Failed to load grammar (convert words to numbers)?
(too old to reply)
Bhuvan Ram
2011-06-28 11:48:00 UTC
Permalink
I had a grammar as

<GRAMMAR LANGID="409">
<RULE NAME="Digit" ID="100" TOPLEVEL="ACTIVE">
<L PROPNAME="Digit">
<P VAL="0"> zero </P>
<P VAL="0"> oh </P>
<P VAL="1"> one </P>
<P VAL="2"> two </P>
<P VAL="3"> three </P>
<P VAL="4"> four </P>
<P VAL="5"> five </P>
<P VAL="6"> six </P>
<P VAL="7"> seven </P>
<P VAL="8"> eight </P>
<P VAL="9"> nine </P>
</L>
</RULE>
</GRAMMAR>

I am loading the grammar as
grammar.DictationLoad("", SpeechLoadOption.SLOStatic);

grammar.DictationSetState(SpeechRuleState.SGDSInactive);

grammar.CmdLoadFromFile(@"D:\Kalyan\voiceToText
\voiceToText\grammar.xml", SpeechLoadOption.SLOStatic);

grammar.CmdSetRuleIdState(100,
SpeechRuleState.SGDSInactive);

But when is speak "Oh" in mic .. its still displaying Oh only but not
zero.. how to do this?
Juergen Schwietering
2011-07-28 12:49:58 UTC
Permalink
Post by Bhuvan Ram
I had a grammar as
<GRAMMAR LANGID="409">
But when is speak "Oh" in mic .. its still displaying Oh only but not
zero.. how to do this?
The language id is correct for your SAPI installation? They codes must
match. Check ALL the HRESULTS when calling the various functions.
Continue reading on narkive:
Loading...