Share via


SPEAKFLAGS (SAPI 5.3)

Microsoft Speech API 5.3

SPEAKFLAGS

SPEAKFLAGS is used to indicate the type of content that has been sent to a TTS engine, using ISpVoice::Speak or ISpTTSEngine::Speak. These functions use SPEAKFLAGS types in a bit-field, and the values should be combined with a bitwise OR. 

  
    typedef enum SPEAKFLAGS
{
    //--- SpVoice flags
    SPF_DEFAULT,
    SPF_ASYNC,
    SPF_PURGEBEFORESPEAK,
    SPF_IS_FILENAME,
    SPF_IS_XML,
    SPF_IS_NOT_XML,
    SPF_PERSIST_XML,

    //--- Normalizer flags
    SPF_NLP_SPEAK_PUNC,

    //--- TTS Format
    SPF_PARSE_SAPI,
    SPF_PARSE_SSML,
    SPF_PARSE_AUTODETECT

    //--- Masks
    SPF_NLP_MASK,
    SPF_PARSE_MASK,
    SPF_VOICE_MASK,
    SPF_UNUSED_FLAGS
} SPEAKFLAGS;

Elements

  • SPF_DEFAULT
    Specifies that the default settings should be used.  The defaults are:

    • Speak the given text string synchronously
    • Not purge pending speak requests
    • Parse the text as XML only if the first character is a left-angle-bracket (<)
    • Not persist global XML state changes across speak calls
    • Not expand punctuation characters into words.

    To override this default, use the other flag values given below.

  • SPF_ASYNC
    Specifies that the Speak call should be asynchronous. That is, it will return immediately after the speak request is queued.

  • SPF_PURGEBEFORESPEAK
    Purges all pending speak requests prior to this speak call.

  • SPF_IS_FILENAME
    The string passed to ISpVoice::Speak is a file name, and the file text should be spoken.

  • SPF_IS_XML
    The input text will be parsed for XML markup.

  • SPF_IS_NOT_XML
    The input text will not be parsed for XML markup.

  • SPF_PERSIST_XML
    Global state changes in the XML markup will persist across speak calls.

  • SPF_NLP_SPEAK_PUNC
    Punctuation characters should be expanded into words (e.g. "This is a sentence." would become "This is a sentence period").

  • SPF_PARSE_SAPI
    Force XML parsing As MS SAPI.

  • SPF_PARSE_SSML
    Force XML parsing As W3C SSML.

  • SPF_PARSE_AUTODETECT
    The TTS XML format is auto-detected. This is the default if none of these TTS XML format values are present in the bit-field.

  • SPF_NLP_MASK
    This mask is used to remove the SAPI handled flags before ISpTTSEngine::Speak is called. The only flag which the TTS engine must handle is SPF_NLP_SPEAK_PUNC.

  • SPF_PARSE_MASK
    SPF_PARSE_SAPI|SPF_PARSE_SSML.

  • SPF_VOICE_MASK
    This is an existing 5.1 mask, which has every flag bit set. In version 5.3, it has been extended to contain SPF_PARSE_MASK.

  • SPF_UNUSED_FLAGS
    This mask has every unused bit set.