Class PhoneDurationsImpl

java.lang.Object
com.sun.speech.freetts.PhoneDurationsImpl
All Implemented Interfaces:
PhoneDurations

public class PhoneDurationsImpl extends Object implements PhoneDurations
Maintains set of PhoneDuration instances read in from a file. The format of the file is as follows:
 phone mean stddev
 phone mean stddev
 phone mean stddev
 ...
 
Where phone is the phone name, mean is a float representing the mean duration of the phone (typically in seconds), and stddev is a float representing the standard deviation from the mean.
  • Constructor Details

    • PhoneDurationsImpl

      public PhoneDurationsImpl(URL url) throws IOException
      Creates a new PhoneDurationsImpl by reading from the given URL.
      Parameters:
      url - the input source
      Throws:
      IOException - if an error occurs
  • Method Details

    • getPhoneDuration

      public PhoneDuration getPhoneDuration(String phone)
      Gets the PhoneDuration for the given phone. If no duration is applicable, returns null.
      Specified by:
      getPhoneDuration in interface PhoneDurations
      Parameters:
      phone - the phone
      Returns:
      the PhoneDuration for phone