Microsoft Speech SDK
SAPI 5.1
ISpTTSEngineSite::Write
ISpTTSEngineSite::Write sends output data (normally audio) to SAPI.
HRESULT Write(
const void *pBuff,
ULONG cb,
ULONG *pcbWritten
);
Parameters
- pBuff
- Pointer to synthesized speech audio data. The output format is specified by SAPI as a parameter to the ISpTTSEngine::Speak call.
- cb
- The buffer size, in bytes (not samples), of pBuff.
- pcbWritten
- Pointer to a ULONG which receives the number of bytes actually copied.
Return values
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_INVALIDARG | pBuff is bad or invalid. |
E_POINTER | pcbWritten is bad or invalid. |
SPERR_UNINITIALIZED | Output stream cannot be initialized. |
Remarks
SAPI handles sending the audio data to the correct output destination. It is important that any events associated with the audio data are queued by calling ISpEventSink::AddEvents prior to calling this method. This ensures proper synchronization of event firing and audio rendering.