Unit Testing


To test the Speech-Enabled Calendar application:

  1. Download the free implementation of Speech Converter API from the following URL:

    http://freetts. sourceforge .net/docs/index.php

  2. Set the path of the bin directory of J2SDK by executing the following command at the command prompt:

     set path=%path%;D:\j2sdk1.4.0_02\bin; 
  3. 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; 
  4. Copy the SpeechCalendar.java, SpeakText.java, and SelectFormat.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:

     javac *.java 
  5. To run the Speech-Enabled Calendar application, type the following command at the command prompt:

     java SpeechCalendar 
  6. The user interface of the Speech-Enabled Calendar application appears with the Date tab selected, as shown in Figure 2-2. Click the Select Date Format button to select a date format and click OK. The selected date format appears with the Enter Date option, as shown in Figure 2-4:

    click to expand: this figure shows the date format selected by an end user on the date tab.
    Figure 2-4: The Selected Date Format

  7. Click the Speak button to convert the specified date to speech. The specified date is converted to speech, which is audible with the help of speakers .

  8. Click the Day tab to view the Day tab interface, as shown in Figure 2-5:

    click to expand: this figure shows the day tab interface, which displays the current day and allows the end user to enter the required day.
    Figure 2-5: The Day Tab

  9. Click the Time tab to specify a time value, as shown in Figure 2-6:

    click to expand: this figure shows the time tab interface, which displays the current time and allows the end user to enter the required time.
    Figure 2-6: The Time Tab




Java InstantCode. Developing Applications using Java Speech API
Java InstantCode. Developing Applications using Java Speech API
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 46

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net