inpro.incremental.unit
Class SysSegmentIU

java.lang.Object
  extended by inpro.incremental.unit.IU
      extended by inpro.incremental.unit.SegmentIU
          extended by inpro.incremental.unit.SysSegmentIU
All Implemented Interfaces:
java.lang.Comparable<IU>

public class SysSegmentIU
extends SegmentIU


Nested Class Summary
 
Nested classes/interfaces inherited from class inpro.incremental.unit.SegmentIU
SegmentIU.SegmentType
 
Nested classes/interfaces inherited from class inpro.incremental.unit.IU
IU.IUUpdateListener, IU.Progress
 
Field Summary
(package private)  boolean awaitContinuation
           
(package private)  java.util.List<FullPFeatureFrame> hmmSynthesisFeatures
           
(package private)  marytts.htsengine.HTSModel htsModel
           
private static org.apache.log4j.Logger logger
           
(package private)  Label originalLabel
          the label that was originally planned by TTS, before any stretching has been done
private static PHTSParameterGeneration paramGen
           
(package private)  java.util.List<PitchMark> pitchMarks
           
 double pitchShiftInCent
           
(package private)  Label plannedLabel
           
(package private)  IU.Progress progress
          the state of delivery that this unit is in
(package private)  int realizedDurationInSynFrames
          the number of frames that this segment has already been going on
 
Fields inherited from class inpro.incremental.unit.SegmentIU
CONSONANTS, l, TYPE_MAPPING, VOWELS
 
Fields inherited from class inpro.incremental.unit.IU
creationTime, FIRST_IU, groundedIn, grounds, nextSameLevelLinks, previousSameLevelLink, updateListeners
 
Constructor Summary
SysSegmentIU(Label l, java.util.List<PitchMark> pitchMarks)
           
SysSegmentIU(Label l, java.util.List<PitchMark> pitchMarks, java.util.List<FullPFeatureFrame> featureFrames)
           
 
Method Summary
 void addNextSameLevelLink(IU iu)
          adds fSLL, and allows continuation of synthesis
 void appendMaryXML(java.lang.StringBuilder sb)
           
private static int appendSllHtsModel(java.util.List<marytts.htsengine.HTSModel> hmms, IU sll)
          helper, append HMM if possible, return emission length
 void attainPitch(double finalPitch)
          TODO: must be reworked to use PitchMarks change the synthesis frames' pitch curve to attain the given pitch in the final pitch in a smooth manner
private  void awaitContinuation()
           
 void copySynData(SysSegmentIU newSeg)
          copy all data necessary for synthesis -- i.e. the htsModel and pitchmarks
 int durationInSynFrames()
          the duration of this segment in multiples of 5 ms
private  void generateParameterFrames()
           
 FullPFeatureFrame getHMMSynthesisFrame(int req)
           
 IU.Progress getProgress()
          by default, an IU - is complete if the last grounding unit is complete, - is upcoming if the first grounding unit is upcoming, - is ongoing if inbetween those two states - is null if there are no grounding units.
 boolean isVoiced()
           
 double originalDuration()
           
 boolean setAwaitContinuation(boolean b)
          tell this segment that it will be followed by more input later on
 void setHmmSynthesisFrames(java.util.List<FullPFeatureFrame> hmmSynthesisFeatures)
           
 void setHTSModel(marytts.htsengine.HTSModel hmm)
           
 double setNewDuration(double d)
          set a new duration of this segment; if this segment is already ongoing, the resulting duration cannot be shortend to less than what has already been going on (obviously, we can't revert the past)
private  void setProgress(IU.Progress p)
           
 void shiftBy(double offset, boolean recurse)
          shift the start and end times of this (and possibly all following SysSegmentIUs
 double stretch(double factor)
          stretch the current segment by a given factor.
 double stretchFromOriginal(double factor)
           
 java.lang.String toLabelLine()
          SysSegmentIUs may have a granularity finer than 10 ms (5ms)
 java.lang.StringBuilder toMbrolaLine()
          this segment represented as an mbrola line
 
Methods inherited from class inpro.incremental.unit.SegmentIU
endTime, isSilence, isVowel, startTime, toPayLoad, type, updateLabel
 
Methods inherited from class inpro.incremental.unit.IU
addUpdateListener, commit, compareTo, connectSLL, deepToString, duration, equals, getAge, getAmongNextSameLevelLinks, getCreationTime, getID, getNextSameLevelLink, getNextSameLevelLinks, getOngoingGroundedIU, getSameLevelLink, ground, groundedIn, groundIn, groundIn, grounds, hashCode, isCommitted, isCompleted, isOngoing, isRevoked, isUpcoming, notifyListeners, payloadEquals, removeAllNextSameLevelLinks, removeGrin, removeGrin, reorderNextSameLevelLink, revoke, setAsTopNextSameLevelLink, setSameLevelLink, toString, toTEDviewXML, updateOnGrinUpdates
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

private static org.apache.log4j.Logger logger

plannedLabel

Label plannedLabel

originalLabel

Label originalLabel
the label that was originally planned by TTS, before any stretching has been done


pitchMarks

java.util.List<PitchMark> pitchMarks

htsModel

marytts.htsengine.HTSModel htsModel

hmmSynthesisFeatures

java.util.List<FullPFeatureFrame> hmmSynthesisFeatures

pitchShiftInCent

public double pitchShiftInCent

progress

IU.Progress progress
the state of delivery that this unit is in


realizedDurationInSynFrames

int realizedDurationInSynFrames
the number of frames that this segment has already been going on


awaitContinuation

boolean awaitContinuation

paramGen

private static PHTSParameterGeneration paramGen
Constructor Detail

SysSegmentIU

public SysSegmentIU(Label l,
                    java.util.List<PitchMark> pitchMarks,
                    java.util.List<FullPFeatureFrame> featureFrames)

SysSegmentIU

public SysSegmentIU(Label l,
                    java.util.List<PitchMark> pitchMarks)
Method Detail

toMbrolaLine

public java.lang.StringBuilder toMbrolaLine()
Description copied from class: SegmentIU
this segment represented as an mbrola line

Overrides:
toMbrolaLine in class SegmentIU

appendMaryXML

public void appendMaryXML(java.lang.StringBuilder sb)
Overrides:
appendMaryXML in class SegmentIU

setHmmSynthesisFrames

public void setHmmSynthesisFrames(java.util.List<FullPFeatureFrame> hmmSynthesisFeatures)

durationInSynFrames

public int durationInSynFrames()
the duration of this segment in multiples of 5 ms


originalDuration

public double originalDuration()

addNextSameLevelLink

public void addNextSameLevelLink(IU iu)
adds fSLL, and allows continuation of synthesis

Overrides:
addNextSameLevelLink in class IU

setAwaitContinuation

public boolean setAwaitContinuation(boolean b)
tell this segment that it will be followed by more input later on

Returns:
whether a continuation is possible (i.e., the segment hasn't been completed yet

awaitContinuation

private void awaitContinuation()

appendSllHtsModel

private static int appendSllHtsModel(java.util.List<marytts.htsengine.HTSModel> hmms,
                                     IU sll)
helper, append HMM if possible, return emission length


generateParameterFrames

private void generateParameterFrames()

getHMMSynthesisFrame

public FullPFeatureFrame getHMMSynthesisFrame(int req)

setProgress

private void setProgress(IU.Progress p)

stretch

public double stretch(double factor)
stretch the current segment by a given factor. NOTE: as time is discrete (in 5ms steps), the stretching factor that is actually applied may differ from the requested factor.

Parameters:
factor - larger than 1 to lengthen, smaller than 1 to shorten; must be larger than 0
Returns:
the actual duration that has been applied

stretchFromOriginal

public double stretchFromOriginal(double factor)

attainPitch

public void attainPitch(double finalPitch)
TODO: must be reworked to use PitchMarks change the synthesis frames' pitch curve to attain the given pitch in the final pitch in a smooth manner

Parameters:
finalPitch - the log pitch to be reached in the final synthesis frame

setNewDuration

public double setNewDuration(double d)
set a new duration of this segment; if this segment is already ongoing, the resulting duration cannot be shortend to less than what has already been going on (obviously, we can't revert the past)

Returns:
the actual new duration (multiple of 5ms)

shiftBy

public void shiftBy(double offset,
                    boolean recurse)
shift the start and end times of this (and possibly all following SysSegmentIUs

Overrides:
shiftBy in class SegmentIU

getProgress

public IU.Progress getProgress()
Description copied from class: IU
by default, an IU - is complete if the last grounding unit is complete, - is upcoming if the first grounding unit is upcoming, - is ongoing if inbetween those two states - is null if there are no grounding units.

Overrides:
getProgress in class IU

toLabelLine

public java.lang.String toLabelLine()
SysSegmentIUs may have a granularity finer than 10 ms (5ms)

Overrides:
toLabelLine in class IU

isVoiced

public boolean isVoiced()

setHTSModel

public void setHTSModel(marytts.htsengine.HTSModel hmm)

copySynData

public void copySynData(SysSegmentIU newSeg)
copy all data necessary for synthesis -- i.e. the htsModel and pitchmarks