ISpGrammarCompiler::CompileStream

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

ISpGrammarCompiler::CompileStream

ISpGrammarCompiler::CompileStream loads the XML grammar and produces the binary grammar format.

Compiles the SAPI 5 Speech Text Grammar 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.