ISpTTSEngine::Speak
Other versions of this page are also available for the following:
8/28/2008
This method renders audio data and events. The caller provides the text to be rendered, in a linked list of text fragments with associated XML attribute states. Also provided in the call are the output format for text rendering and the output site to which the engine will write audio data and events.
Syntax
HRESULT Speak(
DWORD dwSpeakFlags,
REFGUID rguidFormatId,
const WaveFormatEx* pWaveFormatEx,
const SPVTEXTFRAG* pTextFragList,
ISpTTSEngineSite* pOutputSite
);
Parameters
- dwSpeakFlags
[in] Flags defined for the SPEAKFLAGS enumeration. All values other than SPF_NLP_SPEAK_PUNC are masked off. If SPF_NLP_SPEAK_PUNC is set, the TTS engine should speak all punctuation. For example, "This is a sentence." should be expanded to "This is a sentence period".
rguidFormatId
[in] Stream format identifier describing the output format. This format is guaranteed to be one that the TTS engine specified as supported in a previous call to ISpTTSEngine::GetOutputFormat.Value Description SPDFID_Text
Output in the form of text. Engines are not required to support this format. If they do support it, they are not required to do anything specific with it. It is provided merely for debugging purposes.
SPDFID_WaveFormatEx
Output in the form of a WAVEFORMATEX structure.
- pWaveFormatEx
[in] Pointer to a WAVEFORMATEX structure describing the output format. This value is NULL if rguidFormatId is set to SPDFID_Text.
- pTextFragList
[in] Pointer to a linked list of SPVTEXTFRAG structures identifying text fragments to synthesize and render.
- pOutputSite
[in] Pointer to an object implementing ISpTTSEngineSite to which the engine should write audio data and events.
Return Value
The following table shows the possible return values.
Value | Description |
---|---|
S_OK |
Function completed successfully. |
FAILED(hr) |
Appropriate error message. |
Requirements
Header | sapiddk.h, sapiddk.idl |
Library | sapilib.lib |
Windows Embedded CE | Windows CE .NET 4.1 and later |