Package com.sun.speech.freetts
Class FreeTTSTime
java.lang.Object
com.sun.speech.freetts.FreeTTS
com.sun.speech.freetts.FreeTTSTime
Standalone utility that tells the time.
Defaults to "alan" voice.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
The main entry point for FreeTTSTime.void
safeTimeToSpeech
(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
(String time) Speaks the given time.static String
timeToString
(int hour, int min) Returns a string that corresponds to the given time.static String
timeToString
(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
-
Constructor Details
-
FreeTTSTime
public FreeTTSTime()Class constructor. -
FreeTTSTime
Class constructor.- Parameters:
voice
- Voice to say time with
-
-
Method Details
-
usage
public static void usage()Prints the usage message for FreeTTSTime. -
timeToString
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
Returns a string that corresponds to the given time.- Parameters:
hour
- the hourmin
- the minutes- Returns:
- the time in string, null if the given time out of range
-
timeToSpeech
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:
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
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
The main entry point for FreeTTSTime.
-