public class AliasDiphone extends Diphone
Modifier and Type | Field and Description |
---|---|
private Diphone |
original |
private String |
originalName |
ALIAS_MAGIC, MAGIC, NAME_LENGTH
Constructor and Description |
---|
AliasDiphone(String name,
String originalName) |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
compare(Diphone other)
Determines if the two diphones are equivalent.
|
void |
dump()
dumps out this Diphone.
|
void |
dumpBinary(ByteBuffer bb)
Dumps the diphone to the given channel.
|
void |
dumpBinary(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.
|
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
private String originalName
public AliasDiphone(String name, String originalName)
name
- The alias name to use for the existing diphoneoriginalName
- the original name of the diphone.public String getOriginalName()
public void setOriginalDiphone(Diphone original)
original
- a diphone object whose getName() must return the same
as our getOriginalName().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(ByteBuffer bb) throws IOException
dumpBinary
in class Diphone
bb
- the ByteBuffer to write toIOException
- if IO error occurspublic void dumpBinary(DataOutputStream os) throws IOException
dumpBinary
in class Diphone
os
- the DataOutputStream to write toIOException
- if IO error occursboolean compare(Diphone other)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses