Browse
 
Tools
Rss Categories

Using the SimpleTTSClient

Reference Number: AA-01531 Views: 4928 0 Rating/ Voters

The SimpleTTSClient is a standalone application that is designed to test the TTS Server’s configuration and functionality. It results in a wav file of the speech synthesis getting saved off to disk, which you can then call for playback into the web application. The source code for the example is also provided, to serve as a teaching aid. 

Note that the resulting .wav files are meant to be used for testing only, and not in a production application.

The example is installed with the LumenVox Engine Installer (Windows) in the installed directory (by defaultC:\Program Files\LumenVox\Engine\) and with the LumenVoxClient RPM (Linux) in /usr/bin (and thus in the path). For Windows the source code is in the installed directory\Examples\ and for Linux the source code is in /usr/share/doc/lumenvox/client/examples/. The source code demonstrates how to use the LumenVox C and C++ API.

We also provide a sample SSML file, called SimpleTTSClient.ssml, which on Windows can be found in the installed directory (i/e/ local to the executable) and on Linux in /usr/share/lumenvox/client/data.

You will find an executable called SimpleTTSClient. When invoked, you can pass parameters in to dictate the text (either in string of via SSML), language, gender, voice, and output file:

Usage: SimpleTTSClient.exe <OPTION> [LANGUAGE] [GENDER] [VOICE] [RATE] [FORMAT] [-o <output_audio_file>] [-i <TTS_ip_address>]

    where <OPTION> is one of:

      -t <text-to-speak>
      -s <SSML-file-path-or-URI>

    where, optionally, [LANGUAGE] is the language that the voice speaks
      -l en-US

    where. optionally, [GENDER] is that of the voice
      -g male

    where, optionally, [VOICE] is one of the voices you've installed.
      -v Paul

    where, optionally, [RATE] is the preferred sample rate (eg : 8000 [default]).
    Options are 8000 or 22050
      -r 8000

    where, optionally, [FORMAT] is the preferred audio format (eg : ULAW [default]).
    Options are ULAW, ALAW or PCM
      -f PCM

    where, optionally, <output_audio_file> is the name to give the file where the audio is to be saved.
      -o some_audio_file_name.wav

    where, optionally, <TTS_ip_address> is the IP address of the LumenVox TTS Server
      -i 192.168.56.101

Sample use:
    SimpleTTSClient.exe -t "Hello World" -l en-US -g male -v Paul -o TTS_Test.wav

This will result in the synthesis of speech saying "Hello World," which is then saved off in a file called TTS_Test.wav, in the current directory.

Note: If the SSML argument is a file without a path, the Linux client will first look in the local directory and then in /usr/share/lumenvox/client/data. The Windows client only looks in the local folder.

If you are unsure of which voice to install and use, please contact LumenVox Support. The complete list of supported voices can be found on the LumenVox TTS Voices page.

Sample output (Windows):

C:\Program Files\Lumenvox\Engine>SimpleTTSClient.exe -t "1999 was the best year ever." -v Rebecca -o BestYear.wav 
Number of SSML markers : 0
Synthesized Audio file saved to BestYear.wav


C:\Program Files\Lumenvox\Engine>SimpleTTSClient.exe -s SimpleTTSClient.ssml -v Chris 
Number of SSML markers : 0
Synthesized Audio file saved to SimpleTTSClient_output.wav

Sample output (Linux):

[root@mynode ~]SimpleTTSClient -t "`date +%Y -d \"1 year ago\"` was the best year ever." -v Rebecca -o BestYear.wav
Number of SSML markers : 0
Synthesized Audio file saved to BestYear.wav

[root@mynode ~]SimpleTTSClient -s SimpleTTSClient.ssml -v Chris 
Number of SSML markers : 0
Synthesized Audio file saved to SimpleTTSClient_output.wav