To test the Voice Synthesizer application:
Download the free implementation of Speech Converter API from the following URL:
http://freetts. sourceforge .net/docs/index.php
Set the path of the bin directory of J2SDK by executing the following command at the command prompt:
Set the classpath of the lib directory of J2SDK and Speech Converter API by executing the following command at the command prompt:
set classpath = %classpath%;d:\j2sdk1.4.0_02\lib;C:\j2sdk1.4.0_02\lib;c: \freetts-bin-1_2_beta\lib\freetts.jar; c:\freetts-bin-1_2_beta\lib\cmulex.jar;c:\freetts-bin-1_2_beta\lib\jsapi.jar;
Copy the TextPad.java, SpeakText.java, and SelectVoice.java files to a folder on your computer. Use the cd command at the command prompt to move to the folder in which you have copied the Java files. Compile the files by using the following javac command:
To run the Voice Synthesizer application, specify the following command at the command prompt:
The user interface of the Voice Synthesizer application appears. Select File->New to create a text file.
Type the required text in the text file, as shown in Figure 3-7:
Figure 3-7: The New Text File
If you want to open an existing text file, select File->Open. The Open dialog box appears.
Select the required file and click the Open button. The contents of the selected file appear in the text area, as shown in Figure 3-8:
Figure 3-8: Opening an Exiting File
Select Voice->Select Voice to select a voice.
Click the Speak button on the user interface to convert text to speech in the selected voice. The text is converted into speech, which is audible with the help of speakers .