com.sun.speech.freetts.diphone
public class AliasDiphone extends Diphone
ALIAS_MAGIC, MAGIC, NAME_LENGTH
Constructor and Description |
---|
AliasDiphone(java.lang.String name,
java.lang.String originalName) |
Modifier and Type | Method and Description |
---|---|
void |
dump()
dumps out this Diphone.
|
void |
dumpBinary(java.nio.ByteBuffer bb)
Dumps the diphone to the given channel.
|
void |
dumpBinary(java.io.DataOutputStream os)
Dumps the diphone to the given channel.
|
int |
getMidPoint()
Returns the midpoint index. the midpoint index is the sample
that divides the diphone into the first and second parts.
|
java.lang.String |
getOriginalName()
Get the name of the original name that this alias points to.
|
int |
getPbPositionMillis()
Returns the midpoint index. the midpoint index is the sample
that divides the diphone into the first and second parts.
|
Sample[] |
getSamples()
Returns the samples associated with this diphone.
|
Sample |
getSamples(int which)
Returns a particular sample.
|
int |
getUnitSize(int unitPart)
Returns the total number of residuals in the given part for this
diphone.
|
Sample |
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.
|
getName, loadBinary, loadBinary
public AliasDiphone(java.lang.String name, java.lang.String originalName)
name
- The alias name to use for the existing diphoneoriginalName
- the original name of the diphone.public java.lang.String getOriginalName()
public void setOriginalDiphone(Diphone original)
original
- a diphone object whose getName() must return the same
as our getOriginalName().java.lang.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().public Sample[] getSamples()
getSamples
in class Diphone
public Sample getSamples(int which)
getSamples
in class Diphone
which
- which sample to returnpublic int getMidPoint()
getMidPoint
in class Diphone
public int getPbPositionMillis()
getPbPositionMillis
in class Diphone
public Sample nearestSample(float uIndex, int unitPart)
nearestSample
in class Diphone
uIndex
- the desired indexunitPart
- do we want the first have (1) or the second
half (2)public int getUnitSize(int unitPart)
getUnitSize
in class Diphone
unitPart
- indicates which part is of interest (1 or 2)public void dumpBinary(java.nio.ByteBuffer bb) throws java.io.IOException
dumpBinary
in class Diphone
bb
- the ByteBuffer to write tojava.io.IOException
- if IO error occurspublic void dumpBinary(java.io.DataOutputStream os) throws java.io.IOException
dumpBinary
in class Diphone
os
- the DataOutputStream to write tojava.io.IOException
- if IO error occurs