Microsoft Speech SDK
SAPI 5.1
ISpSREngine::WordNotify
ISpSREngine::WordNotify notifies the SR engine when words in command and control grammars are being added or removed.
HRESULT WordNotify(
SPCFGNOTIFY Action,
ULONG cWords,
const SPWORDENTRY * pWords
);
Parameters
- Action
- The SPCFGNOTIFY enumeration value specifying which action, add or delete, is occurring. This will either be SPCFGN_ADD when words are added, or SPCFGN_REMOVE when they are deleted.
- cWords
- The number of words contained in pWords.
- pWords
- Array of SPWORDENTRY structures containing information on each word.
Return values
Value | Description |
---|---|
S_OK | Function completed successfully. |
SPERR_NO_WORD_PRONUNCIATION | The engine could not generate a pronunciation for some of the words added. |
FAILED(hr) | Other appropriate error message. |
Remarks
This method is called by SAPI when words are added or removed when the application loads, unloads, or modifies grammars. SAPI internally keeps a reference count and each word will be added only if it is not already present in any existing grammar.