ISpTTSEngine::Speak

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.

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 Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
FAILED(hr) Appropriate error message.

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Sapiddk.h, Sapiddk.idl.
Link Library: Sapilib.lib.

See Also

ISpTTSEngine | SAPI Interfaces

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.