# FreeTTS Web Start Clock

This demo shows how to use FreeTTS with JavaTM Web Start. With Java Web Start, you launch applications simply by clicking on a Web page link. If the application is not present on your computer, Java Web Start automatically downloads all necessary files. It then caches the files on your computer so the application is always ready to be relaunched anytime you want -- either from an icon on your desktop or from the browser link. And no matter which method you use to launch the application, the most current version of the application is always presented to you.

## Setup

### Web Server

1. Your web server must be configured to return the proper MIME type for the JNLP content. Refer to the JavaTM Web Start Developer's Guide, Setting up the Web site, for details.

### Client

1. Download and install Java Web Start. Java Web Start is already included in the latest version of J2SETM. Since you will need J2SE version 1.4 for FreeTTS, no extra download and installation should be required. Refer to the Java Web Start Installation Guide for installation. It also tells you how to set up your web browser appropriately, which normally means handling the Java Web Start MIME type (`"application/x-java-jnlp-file"`) using the `javaws` executable file in your Java Web Start directory.

2. IMPORTANT: Edit the file clock.jnlp. Change the `"<jnlp codebase="...">"` tag to point to the absolute URL of this directory, e.g., `codebase="http://www.yourwebsite.com/FreeTTS/demo/JSAPI/WebStartClock"`. Unfortunately, the codebase attribute currently cannot be relative. For more information, refer to the Java Web Start FAQ. Moreover, if you use file URLs (e.g., "file:/home/usr1/..."), it might not work properly on differently platforms. So we encourage you to use HTTP URLs.

   If you have created your own voice for the time domain (see FestVoxToFreeTTS), you can modify `clock.jnlp` to tell it to use your voice. Merely change the following line in `clock.jnlp` to use the class name of the `VoiceDirectory` for your voice:

   `<property name="freetts.voices"` `value="com.sun.speech.freetts.en.us.cmu_time_awb.AlanVoiceDirectory"/>`

3. Build WebStartClock. If you are not planning on making any changes to WebStartClock, you do not need to rebuild anything. However, if you would like to make changes to WebStartClock and would like to rebuild it, run the following command:

   `ant -find demo.xml deploy_webstartclock`

   This will create a WebStartClock.tar file containing all the files you need to copy to your web server. Note that you must also unpack `jsapi.jar` to build the WebStartClock. See how set up your environment to use JSAPI to unpack `jsapi.jar`.

## Demo

After you have done the "Setup" above, launch the Web Start Clock demo by clicking on this link:

#### Launch

You can also run this demo locally without needing to use Web Start. To run this demo, type the following command from a command window at the top level FreeTTS directory:

`java -jar bin/WebStartClock.jar`

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