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 |
TTS_PARAM_CACHE_TIMEOUT_OPEN |
|
TTS_PARAM_COMPANY_NAME |
|
TTS_PARAM_ESCAPE_SEQUENCE |
|
TTS_PARAM_FREQUENCY |
|
TTS_PARAM_INET_ACCEPT_COOKIES |
|
TTS_PARAM_INET_CACHE_CONTROL_MAX_AGE |
|
TTS_PARAM_INET_CACHE_CONTROL_MAX_STALE |
|
TTS_PARAM_INET_TIMEOUT_DOWNLOAD |
|
TTS_PARAM_INET_TIMEOUT_IO |
|
TTS_PARAM_INET_TIMEOUT_OPEN |
|
TTS_PARAM_LANGUAGE |
|
TTS_PARAM_LID_LANGUAGES |
|
TTS_PARAM_LID_MODE |
|
TTS_PARAM_LID_SCOPE |
|
TTS_PARAM_MARKER_MODE |
|
output_type |
TTS_PARAM_OUTPUT_TYPE |
TTS_PARAM_PRODUCT_VERSION |
|
TTS_PARAM_SECURE_CONTEXT |
|
TTS_PARAM_SSML_VALIDATION |
|
TTS_PARAM_VOICE |
|
TTS_PARAM_VOICE_AGE |
|
TTS_PARAM_VOICE_GENDER |
|
TTS_PARAM_VOICE_MODEL |
|
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);