TtsSessionStartEx
Associate a Vocalizer instance with an application-defined session, including an optional session configuration and a session identifier string.
The session configuration is an XML file that can change multiple Vocalizer parameters and load multiple tuning data URIs. The session identifier string is reported in all Vocalizer error, diagnostic, and event messages for the instance going forward until TtsSessionEnd is called, providing a way to link those Vocalizer messages to an application-level session. Typically, the application calls TtsSessionStartEx once at the start of a sequence of requests for a single end user, then TtsSessionEnd if the instance will be re-used for another end user. Alternatively, Vocalizer can simply be closed using TtsClose.
TTSRETVAL TtsSessionStartEx (
HTTSINSTANCE hTtsInst,
const LH_CHAR * szSessionID,
const LH_VOID *pSessionConfig,
LH_U32 cSessionConfigBytes,
VXIMap* pSensitiveEvents)
Argument |
Description |
---|---|
hTtsInst |
[in] Handle to a Vocalizer instance. |
szSessionID |
[in] Application-defined NULL-terminated session identifier string. |
pSessionConfig |
[in] Optional pointer to a session configuration. If not using a session configuration, pass NULL. To pass through an existing session.xml file, you add the entire contents (all elements) of the file to a buffer. |
cSessionConfigBytes |
[in] Length of pSessionConfig in bytes, or 0 if a session configuration buffer is not being provided. |
pSensitiveEvents |
[in/out] Optional application-provided VXIMap that gets populated with the list of Vocalizer events and tokens that may expose confidential information, such as for an application that speaks credit card information. If this information is not required, pass NULL. The keys of the VXIMap are the confidential event names. The values are a VXIVector with a VXIString for each confidential token name for that event. |
Note: TtsSessionEnd does not reset all the parameters set via session.xml to their original values. If a session.xml is being used, it is better to simply close the instance via TtsClose at the end of the session, then open a new instance for the next session. Vocalizer is very efficient at closing and opening TTS instances, so there is little overhead in doing so.