Class FreeTTSTime


  • public class FreeTTSTime
    extends FreeTTS
    Standalone utility that tells the time. Defaults to "alan" voice.
    • 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.