1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
6 * Copyright 2001,2003 Sun Microsystems, Inc.
8 * See the file "license.terms" for information on usage and
9 * redistribution of this file, and for a DISCLAIMER OF ALL
16 <head><title>FreeTTS Client/Server Demo</title></head>
19 <table bgcolor="#FFCC66" width="100%">
21 <td align=center width="100%">
22 <h1>FreeTTS Client/Server Demo</h1>
28 <p>This demo provides an example of how to run a FreeTTS
29 synthesizer as a server on the network: a simple client sends
30 the server some text, and the the server streams back audio.
31 Note that since we use a very simple socket-based protocol for
32 the server, the client can be written in any language (i.e.,
33 <i>the client does not have to be written in the Java<sup>TM</sup>
34 programming language</i>).
36 <p>People have used this demo as the basis for generating
37 speech output on a wireless PDA.
40 <p>To build this demo, merely type the following in a shell from
41 any directory in the FreeTTS hierarchy:
43 <code>ant -find demo.xml</code>
45 <p>Doing so will create
46 <code>bin/Server.jar</code> and
47 <code>bin/Client.jar</code> under the top level directory.
48 You can run both using <code>java -jar</code> (see "Running" below).
50 <p>We've also provided a simple C client,
51 <code>client.c</code>, which you can compile using the
54 <code>gcc -Wall -lxnet -o cclient client.c</code>
57 <h3>Running the Server</h3>
58 <p>To use this demo, you need to run two things: the Server
61 <p>To run the Server, on the machine you want to run the
62 server, type the following from a command window at the
63 top level FreeTTS directory:
65 <code>java -jar bin/Server.jar</code>
68 <p>This runs the TTS Server at port 5555. To change the port,
69 modify the <code>port</code> system property:
71 <p><code>java -Dport=5555 -jar bin/Server.jar</code></p>
74 <p>The Server will start and will configure itself to support
75 requests for both 8kHz and 16kHz voices. You should see the
78 <code>Waiting on ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=5555]</code>
81 <p>To specify the 8kHz and 16kHz voices, you need to set the
82 <code>voice8kName</code> and <code>voice16kName</code> system
83 properties (default values shown):
85 <p><code>java -Dvoice8kName=kevin -Dvoice16kName=kevin16 -jar bin/Server.jar</code>
86 <br><code>java -Dvoice16kName=mbrola_us1 -Dmbrola.base=/usr/local/mbrola -jar bin/Server.jar</code> (*)</p>
88 <p>(*) The MBROLA voices are 16kHz voices. You must <a
89 href="../../../mbrola/README.html">setup and install
90 MBROLA</a> before using MBROLA voices.</p>
93 <p>To see how quickly the server handles TTS request, you can
94 set the <code>metrics</code> system property to
95 <code>true</code>. This will cause the "time to first byte
96 sent" to client to be printed out for each TTS request:
98 <code>java -Dmetrics=true -jar bin/Server.jar</code>
101 <h3>Running the Client</h3>
102 <p>To run the client, you need to tell it where the Server is
103 running by setting the <code>server</code>,
104 <code>port</code>, <code>sampleRate</code> and
105 <code>metrics</code> properties (default values shown):
107 <p><code>java -Dserver=localhost -Dport=5555
108 -DsampleRate=16000 -Dmetrics=false -jar bin/Client.jar</code></p>
111 <p>To run the C client, you can run it with the following
114 <code>cclient [server [port [sample_rate [show_metrics]]]]</code>
118 server: the host name of speech server
119 port: port where the speech server is listening
120 sample_rate: 8000 or 16000
124 <p>After running either of the clients, the following prompt
127 Receiving : 32886 samples
131 <p>and you should hear a voice saying "type in what you want
132 me to say." At this point, you should hear what you type in
137 <p>See the <a href="../../../license.terms">license terms</a>
138 and <a href="../../../acknowledgments.txt">acknowledgments</a>.
140 Copyright 2001,2003 Sun Microsystems, Inc. All Rights
141 Reserved. Use is subject to license terms.</p>