upstream version 1.2.2
[debian/freetts] / demo / freetts / ClientServer / README.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
3 <!--
4
5 /**
6  * Copyright 2001,2003 Sun Microsystems, Inc.
7  * 
8  * See the file "license.terms" for information on usage and
9  * redistribution of this file, and for a DISCLAIMER OF ALL 
10  * WARRANTIES.
11  */
12
13 -->
14
15 <html>
16     <head><title>FreeTTS Client/Server Demo</title></head>
17     <body>
18         <center>
19             <table bgcolor="#FFCC66" width="100%">
20                 <tr>
21                     <td align=center width="100%">
22                         <h1>FreeTTS Client/Server Demo</h1>
23                     </td>
24                 </tr>
25             </table>
26         </center>
27
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>).
35
36         <p>People have used this demo as the basis for generating
37         speech output on a wireless PDA.
38
39         <h3>Building</h3>
40         <p>To build this demo, merely type the following in a shell from
41         any directory in the FreeTTS hierarchy:
42         <ul>
43             <code>ant -find demo.xml</code>
44         </ul>
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).
49
50         <p>We've also provided a simple C client,
51         <code>client.c</code>, which you can compile using the 
52         following command:
53         <ul>
54             <code>gcc -Wall -lxnet -o cclient client.c</code>
55         </ul>
56
57         <h3>Running the Server</h3>
58         <p>To use this demo, you need to run two things: the Server 
59         and the Client.
60
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:
64         <ul>
65             <code>java -jar bin/Server.jar</code>
66         </ul>
67
68         <p>This runs the TTS Server at port 5555. To change the port,
69         modify the <code>port</code> system property:
70         <ul>
71             <p><code>java -Dport=5555 -jar bin/Server.jar</code></p>
72         </ul>
73
74         <p>The Server will start and will configure itself to support
75         requests for both 8kHz and 16kHz voices.  You should see the
76         following output:
77         <ul>
78             <code>Waiting on ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=5555]</code>
79         </ul>
80
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):
84         <ul>
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>
87
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>
91         </ul>
92     
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:
97         <ul>
98             <code>java -Dmetrics=true -jar bin/Server.jar</code>
99         </ul>
100
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):
106         <ul>
107             <p><code>java -Dserver=localhost -Dport=5555
108             -DsampleRate=16000 -Dmetrics=false -jar bin/Client.jar</code></p>
109         </ul>
110
111         <p>To run the C client, you can run it with the following
112         optional arguments:
113         <ul>
114             <code>cclient [server [port [sample_rate [show_metrics]]]]</code>
115         </ul>
116         <p>where:
117 <pre>
118      server:       the host name of speech server
119      port:         port where the speech server is listening
120      sample_rate:  8000 or 16000
121      show_metrics: 0 or 1
122 </pre>
123
124         <p>After running either of the clients, the following prompt
125         should appear:
126 <pre>
127      Receiving : 32886 samples
128      Say       : 
129 </pre>
130
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
133         (and press Enter).
134
135         <hr>
136
137         <p>See the <a href="../../../license.terms">license terms</a>
138         and <a href="../../../acknowledgments.txt">acknowledgments</a>.
139         <br>
140         Copyright 2001,2003 Sun Microsystems, Inc.  All Rights
141         Reserved.  Use is subject to license terms.</p>
142     </body>
143 </html>