FreeTTS Client/Server Demo

This demo provides an example of how to run a FreeTTS synthesizer as a server on the network: a simple client sends the server some text, and the the server streams back audio. Note that since we use a very simple socket-based protocol for the server, the client can be written in any language (i.e., the client does not have to be written in the JavaTM programming language).

People have used this demo as the basis for generating speech output on a wireless PDA.


To build this demo, merely type the following in a shell from any directory in the FreeTTS hierarchy:

Doing so will create bin/Server.jar and bin/Client.jar under the top level directory. You can run both using java -jar (see "Running" below).

We've also provided a simple C client, client.c, which you can compile using the following command:

Running the Server

To use this demo, you need to run two things: the Server and the Client.

To run the Server, on the machine you want to run the server, type the following from a command window at the top level FreeTTS directory:

This runs the TTS Server at port 5555. To change the port, modify the port system property:

The Server will start and will configure itself to support requests for both 8kHz and 16kHz voices. You should see the following output:

To specify the 8kHz and 16kHz voices, you need to set the voice8kName and voice16kName system properties (default values shown):

To see how quickly the server handles TTS request, you can set the metrics system property to true. This will cause the "time to first byte sent" to client to be printed out for each TTS request:

Running the Client

To run the client, you need to tell it where the Server is running by setting the server, port, sampleRate and metrics properties (default values shown):

To run the C client, you can run it with the following optional arguments:


     server:       the host name of speech server
     port:         port where the speech server is listening
     sample_rate:  8000 or 16000
     show_metrics: 0 or 1

After running either of the clients, the following prompt should appear:

     Receiving : 32886 samples
     Say       : 

and you should hear a voice saying "type in what you want me to say." At this point, you should hear what you type in (and press Enter).

See the license terms and acknowledgments.
Copyright 2001,2003 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.