Package com.sun.speech.freetts.clunits
Class ClusterUnitSelector
- java.lang.Object
-
- com.sun.speech.freetts.clunits.ClusterUnitSelector
-
- All Implemented Interfaces:
UtteranceProcessor
public class ClusterUnitSelector extends java.lang.Object implements UtteranceProcessor
Generates the Unit Relation of an Utterance from the Segment Relation.
-
-
Constructor Summary
Constructors Constructor Description ClusterUnitSelector(java.net.URL url)
Constructs a ClusterUnitSelector.ClusterUnitSelector(java.net.URL url, de.dfki.lt.freetts.ClusterUnitNamer unitNamer)
Constructs a ClusterUnitSelector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SampleInfo
getSampleInfo()
Get 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.java.lang.String
toString()
Retrieves the string representation of this object.
-
-
-
Constructor Detail
-
ClusterUnitSelector
public ClusterUnitSelector(java.net.URL url) throws java.io.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 database1- Throws:
java.io.IOException
- if an error occurs while loading the database
-
ClusterUnitSelector
public ClusterUnitSelector(java.net.URL url, de.dfki.lt.freetts.ClusterUnitNamer unitNamer) throws java.io.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:
java.io.IOException
- if an error occurs while loading the database
-
-
Method Detail
-
getSampleInfo
public SampleInfo getSampleInfo()
Get the sample info for the underlying database.- Returns:
- the sample info object
-
processUtterance
public void processUtterance(Utterance utterance) throws ProcessException
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
protected void setUnitName(Item seg)
Sets the cluster unit name given the segment.- Parameters:
seg
- the segment item that gets the name
-
toString
public java.lang.String toString()
Retrieves the string representation of this object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string representation of this object
-
-