Browse
 
Tools
Rss Categories

LVTTSClient::Initialize

Reference Number: AA-01035 Views: 2508 0 Rating/ Voters

Initialize an LVTTSClient object for any subsequent TTS operations.

Function

  • LV_TTS_RETURN_CODE Initialize(const char * lang_code, const char * gender, const char * speaker_name, unsigned int sampling_rate)

Parameters

lang_code

The language of the voice that is to be used for synthesis.

See LumenVox TTS Voices for a complete list of available lang_code options

gender

The default gender of the voice that is to be used for synthesis. If speaker_name is not NULL, the gender of the chosen speaker will override this setting. Possible values are "Male" and "Female".

speaker_name

Specify the name of the speaker whose voice is to be used for synthesis. If NULL, a general voice for the specified gender will be used.

See LumenVox TTS Voices for a complete list of available speakers

sampling_rate

The sampling rate (in Hz) the synthesized audio is expected to be produced in.

In most cases, this should be set to a value of 8000 (representing the default 8 KHz)

If you have purchased 22 kHz licenses and wish to use them, the sampling_rate value to use here should be 22050

Return Values

LV_SUCCESS

No errors; the call succeeded.

LV_INVALID_API_PARAMETER

One or more specified parameters to the call are invalid.

LV_NO_COMPATIBLE_TTS_SERVERS

None of the connected TTS servers carry a voice corresponding to the requested features.

LV_ACQUIRING_LICENSE_FAILED

Acquiring of a license matching the specified voice specifications failed.

LV_EXCEPTION

An exception occurred while processing the request.

Remarks

The above inputs to the call only specify the defaults. If the input for synthesis is an SSML document, any additionally required voices are loaded automatically (if available).

Upon successful return, the associated TTS client object handle is initialized for use in most other API functions. When done with, it must be released by calling Destroy to release the acquired license and free up other associated resources.