|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.speech.freetts.diphone.Diphone
Represents two adjacent phones. A diphone is defined by its name, the set of audio data, and information used to help stitch diphones together. This class is immutable.
| Field Summary | |
protected static int |
ALIAS_MAGIC
|
protected static int |
MAGIC
|
protected static int |
NAME_LENGTH
|
| Constructor Summary | |
protected |
Diphone(java.lang.String name)
Constructor to be used only by subclasses who do not use the variables except for the name |
|
Diphone(java.lang.String name,
Sample[] samples,
int midPoint)
Creates a diphone with the given name, samples and midpoint. |
| Method Summary | |
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 |
getName()
Gets the name of the diphone. |
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. |
static Diphone |
loadBinary(java.nio.ByteBuffer bb)
Loads a new diphone from the given buffer. |
static Diphone |
loadBinary(java.io.DataInputStream dis)
Loads a new diphone from the given DataInputStream. |
Sample |
nearestSample(float uIndex,
int unitPart)
Returns the sample that is closest to uIndex. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int MAGIC
protected static final int ALIAS_MAGIC
protected static final int NAME_LENGTH
| Constructor Detail |
public Diphone(java.lang.String name,
Sample[] samples,
int midPoint)
name - the name of the diphonesamples - the set of samples for the diphonemidPoint - the index of the sample midpointprotected Diphone(java.lang.String name)
name - the name of the diphone| Method Detail |
public Sample[] getSamples()
public Sample getSamples(int which)
which - which sample to return
public java.lang.String getName()
public int getMidPoint()
public int getPbPositionMillis()
public Sample nearestSample(float uIndex,
int unitPart)
uIndex - the desired indexunitPart - do we want the first have (1) or the second
half (2)
public int getUnitSize(int unitPart)
unitPart - indicates which part is of interest (1 or 2)
public void dump()
public void dumpBinary(java.nio.ByteBuffer bb)
throws java.io.IOException
bb - the ByteBuffer to write to
java.io.IOException - if IO error occurs
public void dumpBinary(java.io.DataOutputStream os)
throws java.io.IOException
os - the DataOutputStream to write to
java.io.IOException - if IO error occurs
public static Diphone loadBinary(java.nio.ByteBuffer bb)
throws java.io.IOException
bb - the byte buffer to load the diphone from
java.io.IOException - if IO error occurs
public static Diphone loadBinary(java.io.DataInputStream dis)
throws java.io.IOException
dis - the datainput stream to load the diphone from
java.io.IOException - if IO error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||