com.sun.speech.freetts
Class FreeTTSTime

java.lang.Object
  extended bycom.sun.speech.freetts.FreeTTS
      extended bycom.sun.speech.freetts.FreeTTSTime

public class FreeTTSTime
extends FreeTTS

Standalone utility that tells the time. Defaults to "alan" voice.


Constructor Summary
FreeTTSTime()
          Class constructor.
FreeTTSTime(Voice voice)
          Class constructor.
 
Method Summary
static void main(java.lang.String[] args)
          The main entry point for FreeTTSTime.
 void safeTimeToSpeech(java.lang.String time)
          Speaks the given time.
 void speakNow()
          Tells the current time.
 void timeToSpeech(int hour, int min)
          Speaks the time given the hour and minute.
 void timeToSpeech(java.lang.String time)
          Speaks the given time.
static java.lang.String timeToString(int hour, int min)
          Returns a string that corresponds to the given time.
static java.lang.String timeToString(java.lang.String time)
          Returns a string that corresponds to the given time.
static void usage()
          Prints the usage message for FreeTTSTime.
 
Methods inherited from class com.sun.speech.freetts.FreeTTS
fileToSpeech, getInputMode, getSilentMode, getVoice, setAudioFile, setInputMode, setMultiAudio, setSilentMode, setStreamingAudio, shutdown, startup, streamToSpeech, textToSpeech, urlToSpeech
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreeTTSTime

public FreeTTSTime()
Class constructor.


FreeTTSTime

public FreeTTSTime(Voice voice)
Class constructor.

Parameters:
voice - Voice to say time with
Method Detail

usage

public static void usage()
Prints the usage message for FreeTTSTime.


timeToString

public static java.lang.String timeToString(java.lang.String time)
Returns a string that corresponds to the given time.

Parameters:
time - the time in the form HH:MM
Returns:
the time in string, null if the given time is not in the form HH:MM

timeToString

public static java.lang.String timeToString(int hour,
                                            int min)
Returns a string that corresponds to the given time.

Parameters:
hour - the hour
min - the minutes
Returns:
the time in string, null if the given time out of range

timeToSpeech

public void timeToSpeech(java.lang.String time)
Speaks the given time. Time should be in the exact form HH:MM where HH is the hour 00 to 23, and MM is the minute 00 to 59.

Parameters:
time - the time in the form HH:MM
Throws:
java.lang.IllegalArgumentException - if time is not in the form HH:MM

timeToSpeech

public void timeToSpeech(int hour,
                         int min)
Speaks the time given the hour and minute.

Parameters:
hour - the hour of the day (0 to 23)
min - the minute of the hour (0 to 59)

safeTimeToSpeech

public void safeTimeToSpeech(java.lang.String time)
Speaks the given time. Prints an error message if the time is ill-formed.

Parameters:
time - the time in the form HH:MM

speakNow

public void speakNow()
Tells the current time.


main

public static void main(java.lang.String[] args)
The main entry point for FreeTTSTime.