Package com.sun.speech.freetts.clunits
Class ClusterUnitSelector
java.lang.Object
com.sun.speech.freetts.clunits.ClusterUnitSelector
- All Implemented Interfaces:
UtteranceProcessor
Generates the Unit Relation of an Utterance from the
Segment Relation.
-
Constructor Summary
ConstructorsConstructorDescriptionClusterUnitSelector
(URL url) Constructs a ClusterUnitSelector.ClusterUnitSelector
(URL url, de.dfki.lt.freetts.ClusterUnitNamer unitNamer) Constructs a ClusterUnitSelector. -
Method Summary
Modifier and TypeMethodDescriptionGet the sample info for the underlying database.void
processUtterance
(Utterance utterance) Generates the Unit Relation from the Segment Relation.protected void
setUnitName
(Item seg) Sets the cluster unit name given the segment.toString()
Retrieves the string representation of this object.
-
Constructor Details
-
ClusterUnitSelector
Constructs a ClusterUnitSelector.- Parameters:
url
- the URL for the unit database. If the URL path ends with a '.bin' it is assumed that the DB is a binary database, otherwise, its assumed that its a text database1- Throws:
IOException
- if an error occurs while loading the database
-
ClusterUnitSelector
public ClusterUnitSelector(URL url, de.dfki.lt.freetts.ClusterUnitNamer unitNamer) throws IOException Constructs a ClusterUnitSelector.- Parameters:
url
- the URL for the unit database. If the URL path ends with a '.bin' it is assumed that the DB is a binary database, otherwise, its assumed that its a text database1unitNamer
- an optional unit namer, specifying how the cluster units are called in the voice database referenced by url. If this is null, an ldom unit naming scheme will be used (e.g., 'ae_afternoon' for the phoneme 'ae' in the word 'afternoon'.- Throws:
IOException
- if an error occurs while loading the database
-
-
Method Details
-
getSampleInfo
Get the sample info for the underlying database.- Returns:
- the sample info object
-
processUtterance
Generates the Unit Relation from the Segment Relation.
Implementation note:
Populates the segment relation with segment names of the form: XX_YY where XX is the segment name (typically a phoneme) and YY is the word that the segment is in (stripped and lower case). The first step in cluster unit selection is to determine the unit type for each unit in the utterance. The unit type for selection in the simple talking clock example (cmu_time_awb) is done per phone. The unit type consists of the phone name followed by the word the phone comes from (e.g., n_now for the phone 'n' in the word 'now'). Invoke the Viterbi algorithm (via a viterbi class) that selects the proper units for the segment and adds that to each segment item. For each segment, create a unit and attach features based upon the selected units.- Specified by:
processUtterance
in interfaceUtteranceProcessor
- Parameters:
utterance
- the utterance to generate the Unit Relation- Throws:
ProcessException
- if an IOException is thrown during the processing of the utterance
-
setUnitName
Sets the cluster unit name given the segment.- Parameters:
seg
- the segment item that gets the name
-
toString
Retrieves the string representation of this object.
-