hmi.elckerlyc.speechengine
Class WavTTSUnit

java.lang.Object
  extended by hmi.elckerlyc.planunit.AbstractPlanUnit
      extended by hmi.elckerlyc.speechengine.AbstractSpeechUnit
          extended by hmi.elckerlyc.speechengine.TTSUnit
              extended by hmi.elckerlyc.speechengine.WavTTSUnit
All Implemented Interfaces:
PlanUnit, SpeechUnit

public class WavTTSUnit
extends TTSUnit

Plans speach by generating a .wav file, then uses that .wav file to generate the speech

Author:
welberge

Field Summary
private static org.slf4j.Logger logger
           
private  ArrayList<Bookmark> progressHandled
           
private  File tempFile
           
protected  WavUnit wavUnit
           
 
Fields inherited from class hmi.elckerlyc.speechengine.TTSUnit
bookmarks, curVisime, nextVisime, pegs, prevVisime, ttsBinding, visimeDuration, visimes
 
Fields inherited from class hmi.elckerlyc.speechengine.AbstractSpeechUnit
bmlStartTime, speechText
 
Fields inherited from class hmi.elckerlyc.planunit.AbstractPlanUnit
bmlBlockPeg
 
Constructor Summary
WavTTSUnit(BMLBlockPeg bbPeg, String text, String id, String bmlId, TTSBinding ttsBin)
           
WavTTSUnit(BMLBlockPeg bbPeg, String text, String id, String bmlId, TTSBinding ttsBin, Class<? extends Behaviour> behClass)
           
 
Method Summary
protected  TimingInfo getTiming()
           
 void playUnit(double time)
           
 void resetUnit()
           
 void sendProgress(double playTime, double time)
          Send progress feedback for all bookmarks passed at playTime.
 void setParameterValue(String parameter, float value)
          Sets a parameter value
 void setParameterValue(String paramId, String value)
          Sets a parameter value
protected  void setupCache()
           
protected  void startUnit(double time)
          Starts the PlanUnit, is only called once at start
 void stopUnit(double time)
           
 
Methods inherited from class hmi.elckerlyc.speechengine.TTSUnit
getAvailableSyncs, getBehaviourClass, getBookmarks, getBookMarkTime, getBookMarkTimePeg, getBookMarkTimePeg, getPreferedDuration, getRelativeTime, getTime, getTimePeg, getVisimes, hasValidTiming, setTimePeg, setTimePeg, setup
 
Methods inherited from class hmi.elckerlyc.speechengine.AbstractSpeechUnit
getEndPeg, getEndTime, getStartPeg, getStartTime, sendEndProgress, sendStartProgress, setEnd, setStart
 
Methods inherited from class hmi.elckerlyc.planunit.AbstractPlanUnit
addFeedbackListener, feedback, getBMLBlockPeg, getBMLId, getId, getReplacementGroup, getState, isDone, isLurking, isPlaying, isSubUnit, play, reset, setState, setSubUnit, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hmi.elckerlyc.planunit.PlanUnit
addFeedbackListener, feedback, getBMLBlockPeg, getBMLId, getId, getReplacementGroup, getState, isDone, isLurking, isPlaying, isSubUnit, play, reset, setState, start, stop
 

Field Detail

wavUnit

protected WavUnit wavUnit

tempFile

private File tempFile

progressHandled

private ArrayList<Bookmark> progressHandled

logger

private static org.slf4j.Logger logger
Constructor Detail

WavTTSUnit

public WavTTSUnit(BMLBlockPeg bbPeg,
                  String text,
                  String id,
                  String bmlId,
                  TTSBinding ttsBin,
                  Class<? extends Behaviour> behClass)

WavTTSUnit

public WavTTSUnit(BMLBlockPeg bbPeg,
                  String text,
                  String id,
                  String bmlId,
                  TTSBinding ttsBin)
Method Detail

sendProgress

public void sendProgress(double playTime,
                         double time)
Description copied from class: TTSUnit
Send progress feedback for all bookmarks passed at playTime.

Specified by:
sendProgress in interface SpeechUnit
Specified by:
sendProgress in class TTSUnit
Parameters:
playTime - time since start of the speech unit
time - time since start of BML execution

playUnit

public void playUnit(double time)
              throws SpeechUnitPlayException
Specified by:
playUnit in class AbstractPlanUnit
Throws:
SpeechUnitPlayException

stopUnit

public void stopUnit(double time)
Specified by:
stopUnit in class AbstractPlanUnit

resetUnit

public void resetUnit()
Overrides:
resetUnit in class AbstractPlanUnit

startUnit

protected void startUnit(double time)
                  throws PlayException
Description copied from class: AbstractPlanUnit
Starts the PlanUnit, is only called once at start

Overrides:
startUnit in class AbstractPlanUnit
Parameters:
time - global start time
Throws:
PlayException

setupCache

protected void setupCache()
                   throws SpeechUnitPlanningException
Overrides:
setupCache in class TTSUnit
Throws:
SpeechUnitPlanningException - if cache setup failed.

getTiming

protected TimingInfo getTiming()
                        throws SpeechUnitPlanningException
Specified by:
getTiming in class TTSUnit
Throws:
SpeechUnitPlanningException

setParameterValue

public void setParameterValue(String parameter,
                              float value)
Description copied from interface: PlanUnit
Sets a parameter value

Specified by:
setParameterValue in interface PlanUnit
Specified by:
setParameterValue in interface SpeechUnit
Specified by:
setParameterValue in class TTSUnit

setParameterValue

public void setParameterValue(String paramId,
                              String value)
Description copied from interface: PlanUnit
Sets a parameter value