I to need create a programmatic equivalent using delphi language... or could someone post a link on how to do grammars in peech recogniton using the delphi. Or any examples of XML grammar that has programmatic equivalent in Delphi. sorry for my english.
**Programmatic Equivalent **
Ref: http://msdn.microsoft.com/en-us/library/ms723634(v=VS.85).aspx
SPSTATEHANDLE hsHelloWorld;
hr = cpRecoGrammar->GetRule(L"HelloWorld", NULL,
SPRAF_TopLevel | SPRAF_Active, TRUE,
&hsHelloWorld);
hr = cpRecoGrammar->AddWordTransition(hsHelloWorld, NULL,
L"hello world", L" ",
SPWT_LEXICAL, NULL, NULL);
hr = cpRecoGrammar->AddWordTransition(hsHelloWorld, NULL,
L"hiya|there", L"|",
SPWT_LEXICAL, NULL, NULL);
hr = cpRecoGrammar->Commit(NULL);
XML Grammar Sample(s):
<GRAMMAR>
<!-- Create a simple "hello world" rule -->
<RULE NAME="HelloWorld" TOPLEVEL="ACTIVE">
<P>hello world</P>
</RULE>
<RULE NAME="HelloWorld_Disp" TOPLEVEL="ACTIVE">
<P DISP="Hiya there!">hello world</P>
</RULE>
<RULE NAME="Question_Pron" TOPLEVEL="ACTIVE">
<P DISP="I don't understand" PRON="eh">what</P>
</RULE>
<RULE NAME="NurseryRhyme" TOPLEVEL="ACTIVE">
<P>hey</P>
<P MIN="2" MAX="2">diddle</P>
</RULE>
<RULE NAME="UseWeights" TOPLEVEL="ACTIVE">
<LIST>
<P WEIGHT=".95">recognize speech</P>
<P WEIGHT=".05">wreck a nice beach</P>
</LIST>
</RULE>
<RULE NAME="UseProps" TOPLEVEL="ACTIVE">
<P PROPNAME="NOVALUE">one</P>
<P PROPNAME="NUMBER" VAL="2">two</P>
<P PROPNAME="STRING" VALSTR="three">three</P>
</RULE>
</GRAMMAR>