Package com.sun.speech.freetts.diphone
Class AliasDiphone
java.lang.Object
com.sun.speech.freetts.diphone.Diphone
com.sun.speech.freetts.diphone.AliasDiphone
Represent an alias diphone which is just another name for an
already-existing original diphone. This can be used just like a
"real" diphone.
- Author:
- Marc Schröder
-
Field Summary
Fields inherited from class com.sun.speech.freetts.diphone.Diphone
ALIAS_MAGIC, MAGIC, NAME_LENGTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dump()
dumps out this Diphone.void
Dumps the diphone to the given channel.void
dumpBinary
(ByteBuffer bb) Dumps the diphone to the given channel.int
Returns the midpoint index. the midpoint index is the sample that divides the diphone into the first and second parts.Get the name of the original name that this alias points to.int
Returns the midpoint index. the midpoint index is the sample that divides the diphone into the first and second parts.Sample[]
Returns the samples associated with this diphone.getSamples
(int which) Returns a particular sample.int
getUnitSize
(int unitPart) Returns the total number of residuals in the given part for this diphone.nearestSample
(float uIndex, int unitPart) Returns the sample that is closest to uIndex.void
setOriginalDiphone
(Diphone original) Associate the actual diphone object of the original with this alias.Methods inherited from class com.sun.speech.freetts.diphone.Diphone
getName, loadBinary, loadBinary
-
Constructor Details
-
AliasDiphone
- Parameters:
name
- The alias name to use for the existing diphoneoriginalName
- the original name of the diphone.
-
-
Method Details
-
getOriginalName
Get the name of the original name that this alias points to. -
setOriginalDiphone
Associate the actual diphone object of the original with this alias.- Parameters:
original
- a diphone object whose getName() must return the same as our getOriginalName().- Throws:
IllegalArgumentException
- if the diphone to be registered as the original has a name which is different from this AliasDiphone's original name as returned by getOriginalName().
-
getSamples
Returns the samples associated with this diphone.- Overrides:
getSamples
in classDiphone
- Returns:
- the samples associated with this diphone
-
getSamples
Returns a particular sample.- Overrides:
getSamples
in classDiphone
- Parameters:
which
- which sample to return- Returns:
- the desired sample
-
getMidPoint
public int getMidPoint()Returns the midpoint index. the midpoint index is the sample that divides the diphone into the first and second parts.- Overrides:
getMidPoint
in classDiphone
- Returns:
- the midpoint index.
-
getPbPositionMillis
public int getPbPositionMillis()Returns the midpoint index. the midpoint index is the sample that divides the diphone into the first and second parts.- Overrides:
getPbPositionMillis
in classDiphone
- Returns:
- the midpoint index.
-
nearestSample
Returns the sample that is closest to uIndex.- Overrides:
nearestSample
in classDiphone
- Parameters:
uIndex
- the desired indexunitPart
- do we want the first have (1) or the second half (2)- Returns:
- the sample nearest to the given index in the given part
-
getUnitSize
public int getUnitSize(int unitPart) Returns the total number of residuals in the given part for this diphone.- Overrides:
getUnitSize
in classDiphone
- Parameters:
unitPart
- indicates which part is of interest (1 or 2)- Returns:
- the number of residuals in the specified part
-
dump
public void dump()dumps out this Diphone. -
dumpBinary
Dumps the diphone to the given channel.- Overrides:
dumpBinary
in classDiphone
- Parameters:
bb
- the ByteBuffer to write to- Throws:
IOException
- if IO error occurs
-
dumpBinary
Dumps the diphone to the given channel.- Overrides:
dumpBinary
in classDiphone
- Parameters:
os
- the DataOutputStream to write to- Throws:
IOException
- if IO error occurs
-