public class ContourGenerator extends Object implements UtteranceProcessor
Modifier and Type | Field and Description |
---|---|
private static PathExtractor |
endPath |
private static PathExtractor |
lastDaughterEndPath |
private static PathExtractor |
localF0Range |
private static PathExtractor |
localF0Shift |
private float |
modelMean |
private float |
modelStddev |
private static PathExtractor |
postBreakPath |
private static PathExtractor |
preBreakPath |
private F0ModelTerm[] |
terms |
private static PathExtractor |
vowelMidPath |
Constructor and Description |
---|
ContourGenerator(URL url,
float modelMean,
float modelStddev)
Creates a ContourGenerator utterance processor.
|
Modifier and Type | Method and Description |
---|---|
private void |
addTargetPoint(Relation target,
float pos,
float f0)
Adds the target point at the given time to the given frequency
to the given relation.
|
private Interceptor |
applyLrModel(Item syllable)
Applies the linear regression model.
|
private boolean |
isPostBreak(Item syllable)
Determines if this syllable is following a break.
|
private boolean |
isPreBreak(Item syllable)
Determines if this syllable is before a break.
|
private float |
mapF0(float val,
float mean,
float stddev)
Maps the given value to the curve.
|
protected void |
parseAndAdd(List list,
String line)
Parses the line into an F0ModelTerm.
|
void |
processUtterance(Utterance utterance)
Generates the F0 contour for the utterance.
|
String |
toString()
Returns the string representation of the object.
|
private float |
vowelMid(Item syllable)
Returns the time point mid way in vowel in this syllable.
|
private static final PathExtractor endPath
private static final PathExtractor lastDaughterEndPath
private static final PathExtractor postBreakPath
private static final PathExtractor preBreakPath
private static final PathExtractor vowelMidPath
private static final PathExtractor localF0Shift
private static final PathExtractor localF0Range
private final float modelMean
private final float modelStddev
private F0ModelTerm[] terms
public ContourGenerator(URL url, float modelMean, float modelStddev) throws IOException
url
- source of the datamodelMean
- the average frequencymodelStddev
- the std deviation of the frequencyIOException
- if an error occurs while loading datapublic void processUtterance(Utterance utterance) throws ProcessException
processUtterance
in interface UtteranceProcessor
utterance
- the utterance to processProcessException
- if an IOException
is
thrown during the processing of the utteranceprivate Interceptor applyLrModel(Item syllable)
syllable
- the syllable to processInterceptor
private final float vowelMid(Item syllable)
syllable
- the syllable of interestprivate void addTargetPoint(Relation target, float pos, float f0)
target
- the target of interestpos
- the timef0
- the frequencyprivate final boolean isPostBreak(Item syllable)
syllable
- the syllable to checktrue
if this syllable is following a
break; otherwise false
.private final boolean isPreBreak(Item syllable)
syllable
- the syllable to checktrue
if this syllable is before a
break; otherwise false
.private final float mapF0(float val, float mean, float stddev)
val
- the value to mapprotected void parseAndAdd(List list, String line)
list
- resulting F0ModelTerm is added to this listline
- the string to parseWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses