Perform the text to speech synthesis operation for the given sentence or SSML text.
Function
- LV_TTS_RETURN_CODE Synthesize(const char * input_sentence, unsigned int flags)
Parameters
input_sentence
Can be a simple sequence of words or sentences, or can be an SSML document.
Ideally, this text should be encoded in UTF-8 format
flags
Used to control certain facets of the operation. Mostly unused in the current implementation besides LV_TTS_BLOCK. Setting theLV_TTS_BLOCK bit in flags causes the call to wait for a response back from the TTS server before returning. If the LV_TTS_BLOCK flag is not specified, the synthesis will be performed in non-blocking mode, and calls to LVTTSClient::WaitForSynthesis can be used to determine when the synthesis operation has completed.
Return Values
LV_SUCCESS
No errors; synthesis succeeded.
LV_INVALID_TTS_HANDLE
The TTS client handle is invalid (either Initialize has not been called or Destroy has already been called).
LV_NO_COMPATIBLE_TTS_SERVERS
Either none of the connected TTS servers carry a voice corresponding to the requested features, or no TTS servers are available at the time.
LV_SYSTEM_ERROR
If the TTS client has not been initialized yet.
LV_ACQUIRING_LICENSE_FAILED
Either failed to switch license type based on the currently set voice properties or failed to acquire any additionally needed licenses.
LV_EXPIRED_LICENSE
The acquired license(s) do not permit using the current version of the TTS server.
LV_INVALID_LICENSE_MAINT_DATE
The maintenance date of the available license(s) is/are invalid.
LV_INVALID_CLIENT_OBJECT
The internal representation of the TTS Client handle is corrupted.
LV_NO_TTS_SERVERS
Not connected to any TTS server yet.
LV_EXCEPTION
An exception occurred while processing the request.
-- -- The following values may be returned only when blocking synthesis is performed. -- --
LV_SSML_ERROR
The specified SSML had syntax error(s).
LV_RESOURCE_ERROR
The TTS server is out of resources, or no voices have been loaded.
LV_FAILED_NO_VOICE_SPECIFIED
There was an error in the request, no voices were specified.
LV_FAILED_VOICE_LOAD
The TTS server failed to load one or more of the required voices.
LV_FAILED_SYNTHESIS
The input was neither plain text nor SSML; or conversion of input SSML to UTF-8 format failed.
LV_FAILED_STREAMER
An exception occurred on the TTS server while processing the input SSML.
LV_FAILED_AUDIO_CONVERSION
Conversion of the synthesized audio to the requested sound format and/or sampling rate has failed.
LV_TIME_OUT
The synthesis request timed out.