Sign in to follow this  

SAPI rule enumeration

This topic is 401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been using the Microsoft Speech API (SAPI, 5.3) to add speech recognition support to my game (Windows, obviously, C++, Win8 SDK) and aside from a few hoop-jumps relating to loading grammar files it's working quite well.

 

However, I'm having trouble figuring out how to enumerate rules from a grammar that was loaded from file (or if that's even possible).  Obviously, when you build the grammar manually/dynamically, you are creating the rules yourself.   However, there doesn't *appear* to be a way to enumerate the rules from a grammar that was loaded from file.  IspRecoGrammar::GetRule() seems to be the closest thing I could find to being able to query for a rule, but it is intended for retrieving a single, known rule (it requires either a rule name or id).

 

For the time being I'm simply parsing the XML myself and plucking out the rule names, but that's not really a complete solution; I need to support both XML *and* binary grammar config files, the latter of which sidesteps my current work-around.

 

Anyone with SAPI experience know how I might accomplish this?

Share this post


Link to post
Share on other sites

This topic is 401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this