I'm currently developing an application of Speech Recognition using Microsoft Kinect SDK. The goal of the application is to load any (valid) XML file containing the grammar and use it to process speech. For some reason that I haven't understood yet, the application only seems to recognize all the words belonging to the first rule within the XML grammar file. For example, in the following grammar:
<grammar version="1.0" xml:lang="en-US" root="rootRule" tag-format="semantics/1.0-literals" xmlns="http://www.w3.org/2001/06/grammar">
<rule id="rootRule">
<one-of>
<item>
<tag>PEOPLE</tag>
<one-of>
<item> team </item>
<item> kara </item>
<item> john </item>
<item> george </item>
</one-of>
</item>
<item>
<tag>FOOD</tag>
<one-of>
<item> apple </item>
<item> banana </item>
</one-of>
</item>
</one-of>
</rule>
<rule id="anotherRule">
<one-of>
<item>
<tag>COMMANDS</tag>
<one-of>
<item> close </item>
<item> shut down </item>
<item> stop the application </item>
</one-of>
</item>
<item>
<tag>TOYS</tag>
<one-of>
<item> doll </item>
<item> teddy bear </item>
</one-of>
</item>
</one-of>
</rule>
</grammar>
The application will only recognize the words belonging to the rule id "rootRule", ignoring all the ones within the rule id "anotherRule". Why does this happen? I don't manually process the XML file, the SDK already does that, I only supply the location of file using:
spRecEng.LoadGrammar(new Grammar(filename));
And it works fine for the first rule so in theory it should work for all the following ones?!
I'm developing my application based on a already existing one (both have this exact same problem) and its source code can be found at: https://dl.dropboxusercontent.com/u/28555145/KinectForWindowsSpeech.rar