I was looking for the solution of this problem on the board but I coudn't find any posts that would be of much help.
I hope this post will help your if you have a similar problem.

In SAPI you can retrieve the ID and VALUE of the recognised phrase. It is all easy when you work with phrases that were loaded from an XML file. But what happens when you work with Dynamic Grammars?

When using AddWordTransition you can specify your values in SPPROPERTYINFO.
As seen in Coffee05, you need to set the SPPROPERTYINFO.vValue.vt to VT_I4 and set the ulVal to whatever you want. But here comes the problem. Your recognition procedure will always find this to be 0 instead of the value that you put there.

mov Property.vValue.vt, VT_I4
mov Property.vValue.ulVal, VALUE

Puts values at all wrong offsets.
I don't know what is wrong with the structure (I am using NaNs SAPI include file v1.3) but correct offsets would be:

lea eax, Property
mov WORD PTR , VT_I4
Posted on 2005-10-13 17:26:45 by Milos
I hope I got your question right...

The structure is defined as:
typedef struct tagSPPROPERTYINFO{
  const WCHAR* pszName;
  ULONG ulId;
  const WCHAR* pszValue;
  VARIANT vValue;

so the correct offsets should be xxx.vValue.vt = and xxx.vValue.ulVal =
Posted on 2006-04-10 05:59:03 by beaster
Hi Milos
In the last ObjAsm32 package I included a voice recognition app based on SAPI. This stuff is based on the coffee demos and the previous work done by NaN. I translated all the structures and interfaces available for the last SAPI version 5.1.
Perhaps this can help you. The project is located in the \ObjAsm32\Projects\SpeechCmds folder.


Posted on 2006-04-10 06:52:43 by Biterider
Nice :) I will check it out though I have completed the DLL wrapper for the most important SR and TTS functionality some time ago.

Sometimes TTS freezes so maybe I should try your model in case I am doing something wrong in my code.
Posted on 2006-06-04 14:31:59 by Milos