TtsSetParamsEx

Set the value of one or more TTS engine instance parameters.

TTSRETVAL TtsSetParamsEx(
 HTTSINSTANCE hTtsInst,
 const char ** pszParams,
 const char ** pszValues,
 LH_U32 cParams)

Argument

Description

hTtsInst

[in] Handle to a TTS engine instance.

pszParams

[in] List of parameters to set. Each element in this array specifies a NULL-terminated character string for the individual parameter to set. For convenience and to avoid application bugs, the Vocalizer API headers provide #defines for each of the valid parameter names.

pszValues

[in] List of parameter values to set. Each element in this array specifies a NULL-terminated character string for the individual parameter value to set, where pszValues[index] is the value for parameter pszParams[index].

cParams

[in] Number of parameters to set.

If a parameter is set by both TtsSetParamsEx and the session.xml for TtsSessionStartEx, the value from the most recent of these function calls has precedence.

Only TTS_PARAM_VOLUME and TTS_PARAM_RATE can be set while synthesis is in progress. For those two parameters, the change takes effect quickly, but because Vocalizer typically delivers audio faster than real time, there may be a significant number of audio buffers waiting for playback at the audio device; there may be a lag before the end user hears the effects. Applications can avoid this lag by doing rate and volume changes with the audio device instead of with Vocalizer, or by stopping and restarting synthesis, or by minimizing the number of audio buffers queued for the audio output device.

Setting configuration parameters via TtsSetParamsEx:

To set this parameter...

Set this value in TtsSetParamsEx...

application_name

TTS_PARAM_APPLICATION_NAME

cache_timeout_open

TTS_PARAM_CACHE_TIMEOUT_OPEN

company_name

TTS_PARAM_COMPANY_NAME

escape_sequence

TTS_PARAM_ESCAPE_SEQUENCE

frequency

TTS_PARAM_FREQUENCY

inet_accept_cookies

TTS_PARAM_INET_ACCEPT_COOKIES

inet_cache_control_max_age

TTS_PARAM_INET_CACHE_CONTROL_MAX_AGE

inet_cache_control_max_stale

TTS_PARAM_INET_CACHE_CONTROL_MAX_STALE

inet_timeout_download

TTS_PARAM_INET_TIMEOUT_DOWNLOAD

inet_timeout_io

TTS_PARAM_INET_TIMEOUT_IO

inet_timeout_open

TTS_PARAM_INET_TIMEOUT_OPEN

language

TTS_PARAM_LANGUAGE

language_identifier_languages

TTS_PARAM_LID_LANGUAGES

language_identifier_mode

TTS_PARAM_LID_MODE

language_identifier_scope

TTS_PARAM_LID_SCOPE

marker_mode

TTS_PARAM_MARKER_MODE

output_type

TTS_PARAM_OUTPUT_TYPE

product_version

TTS_PARAM_PRODUCT_VERSION

secure_context

TTS_PARAM_SECURE_CONTEXT

ssml_validation

TTS_PARAM_SSML_VALIDATION

voice

TTS_PARAM_VOICE

voice_age

TTS_PARAM_VOICE_AGE

voice_gender

TTS_PARAM_VOICE_GENDER

voice_model

TTS_PARAM_VOICE_MODEL

volume

Prosody-volume

Example

const char *szParamNames[32];
const char *szParamValues[32];
szParamNames[0] = TTS_PARAM_APPLICATION_NAME;
szParamNames[0] = "MyAppName";
TtsSetParamsEx(hTtsInst, zParamNames, szParamValues, 1);