IAPCSpeech::CreateSpkContext

This method creates a new speak context, which allows an application to do pre-text normalization.

Syntax

HRESULT IAPCSpeech::CreateSpkContext ( IAPCSpeech *pSpeech, DWORD dwContext, DWORD dwFlag PDWORD *pNewContext );

Parameters

pSpeech
Pointer to a speech object that contains the dwContext to be copied; used only with APCSPCH_TN_CONTEXT_COPY.
dwContext
Specifies the context identifier of the newly created context that is copied or extended. It is ignored if dwFlag is APCSPCH_TN_CONTEXT_NEW.
dwFlag
Specifies a bitmask of flags. It is one of the following values:
Flag
Value
Description
APCSPCH_TN_CONTEXT_NEW 0x0001 Creates a new empty context.
APCSPCH_TN_CONTEXT_COPY 0x0002 Creates a new context based on an existing context by copying all the rules from the existing context.
APCSPCH_TN_CONTEXT_EXTEND 0x0003 Extends a new context by linking it to an existing one.

pNewContext
Pointer to the identifier of the newly created context if S_OK is returned.

Return Values

S_OK indicates success.

Remarks

An application does not need to create a new speak context in order to use text-to-speech (TTS) because, by default, there is always one speak context with an identifier of 0. An application can also create additional contexts and use IAPCSpeech::SpeakEx to use the new contexts.

When APCSPCH_TN_CONTEXT_EXTEND is used, it can only extend rules of APCSPCH_TN_WORD.

A context can only be extended once.

See Also

IAPCSpeech::SetSpkContextRule