Microsoft Speech Platform
ISpGrammarCompiler::CompileStream
ISpGrammarCompiler::CompileStream loads a SAPI 5 grammar file and produces the binary grammar format. It compiles the grammar file pointed to by pSource stream and writes the output to the pDest stream. It can optionally generate C/C++ header information from the <DEFINE> <ID> tags.
HRESULT CompileStream(
IStream *pSource,
IStream *pDest,
IStream *pHeader,
IUnknown *pReserved,
ISpErrorLog *pErrorLog,
DWORD dwFlags
);
Parameters
- pSource
- Pointer to the source of the XML grammar text.
- pDest
- Pointer to the destination stream for the binary grammar.
- pHeader
- Pointer to the stream to write the C/C++ header information (from the <DEFINE> tags) to (e.g., #define myterm 3).
- pReserved
- Reserved. Do not use.
- pErrorLog
- Pointer to the error log receiving the messages.
- dwFlags
- [in] Not currently used. Must be zero.
Return values
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_INVALIDARG | One of the parameters is bad or invalid. |
FAILED (hr) | Appropriate error message. |