To test the Counting application:
Download the free implementation of the 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 the 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 SpeechCounting.java, SpeakCounting.java, and SelectVoiceType.java files to a folder on your computer. Use the cd command on 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 Counting application, specify the following command at the command prompt:
The user interface of the Counting application appears. Select File->Open from the File menu to open an existing text file. The File 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 5-6:
Figure 5-6: Opening an Existing File
Click the Vowel button to listen to the vowel count in the text provided by an end user.
Click the Constant button to listen to the consonant count in the text provided by an end user.
Click the Word button to listen to the word count in the text provided by an end user.
Click the Sentence button to listen to the sentence count in the text provided by an end user.