hmi.tts
Class AbstractTTSGenerator

java.lang.Object
  extended by hmi.tts.AbstractTTSGenerator
Direct Known Subclasses:
MaryTTSGenerator, SAPI5TTSGenerator

public abstract class AbstractTTSGenerator
extends Object

Abstract implementation for Text-To-Speech generators.

Author:
Herwin

Field Summary
protected  Collection<Bookmark> bookmarks
           
protected  TTSCallback callback
          In the speechengine package of Herwin, this callback is replaced all the time for new speechunits, during setup as well as during speak() time.
protected  TTSCallback permanentCallback
          This callback is supposed to be set only once (see also callback below)
private  int rate
           
protected  Collection<Visime> visimes
           
private  int volume
           
protected  List<WordDescription> wordDescriptions
           
 
Constructor Summary
AbstractTTSGenerator()
           
 
Method Summary
abstract  TimingInfo getBMLTiming(String s)
          Get the timing of a BML speech behavior
 int getRate()
           
abstract  TimingInfo getTiming(String text)
          Gets the timing of the text, fills out visime, phoneme,bookmark and word lists
abstract  String[] getVoices()
          Get the duration of the last spoken/timed text
 int getVolume()
           
 void setCallback(TTSCallback cb)
          Sets up the callbacks
 void setPermanentCallback(TTSCallback cb)
          Sets up the permanent callback
 void setRate(int r)
           
abstract  void setVoice(String speaker)
          Sets the speaker
 void setVolume(int v)
           
abstract  TimingInfo speak(String text)
           
abstract  TimingInfo speakBML(String text)
          Speaks out the BML sentence, does the apropiate callbacks, fills out visime, phoneme, bookmark and word lists
abstract  TimingInfo speakBMLToFile(String text, String filename)
          Generates a file containing the spoken BML sentence, does the apropiate callbacks, fills out visime, phoneme, bookmark and word lists.
abstract  TimingInfo speakToFile(String text, String filename)
          Generates a file containing the spoken sentence, does the apropiate callbacks, fills out visime, phoneme, bookmark and word lists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

permanentCallback

protected TTSCallback permanentCallback
This callback is supposed to be set only once (see also callback below)


callback

protected TTSCallback callback
In the speechengine package of Herwin, this callback is replaced all the time for new speechunits, during setup as well as during speak() time. Therefore, the permanentCallback is added -- that's a callback that is set only once (!)


wordDescriptions

protected List<WordDescription> wordDescriptions

bookmarks

protected Collection<Bookmark> bookmarks

visimes

protected Collection<Visime> visimes

volume

private int volume

rate

private int rate
Constructor Detail

AbstractTTSGenerator

public AbstractTTSGenerator()
Method Detail

setCallback

public void setCallback(TTSCallback cb)
Sets up the callbacks

Parameters:
cb - callback class

setPermanentCallback

public void setPermanentCallback(TTSCallback cb)
Sets up the permanent callback

Parameters:
cb - callback class

speak

public abstract TimingInfo speak(String text)

speakBML

public abstract TimingInfo speakBML(String text)
Speaks out the BML sentence, does the apropiate callbacks, fills out visime, phoneme, bookmark and word lists

Parameters:
text - the text or script to speak

speakToFile

public abstract TimingInfo speakToFile(String text,
                                       String filename)
                                throws IOException
Generates a file containing the spoken sentence, does the apropiate callbacks, fills out visime, phoneme, bookmark and word lists.

Parameters:
text - the text or script to speak
Throws:
FileNotFoundException
IOException

speakBMLToFile

public abstract TimingInfo speakBMLToFile(String text,
                                          String filename)
                                   throws IOException
Generates a file containing the spoken BML sentence, does the apropiate callbacks, fills out visime, phoneme, bookmark and word lists.

Parameters:
text - the text or script to speak
Throws:
IOException

getTiming

public abstract TimingInfo getTiming(String text)
Gets the timing of the text, fills out visime, phoneme,bookmark and word lists

Parameters:
text - the text or script to get the timing of

setVoice

public abstract void setVoice(String speaker)
Sets the speaker

Parameters:
speaker - speaker name

getBMLTiming

public abstract TimingInfo getBMLTiming(String s)
Get the timing of a BML speech behavior

Parameters:
b - the bml speech behavior

getVoices

public abstract String[] getVoices()
Get the duration of the last spoken/timed text

Returns:
duration in s

getVolume

public int getVolume()
Returns:
the volume

setVolume

public void setVolume(int v)
Parameters:
volume - the volume to set, specified in % (0..100)

getRate

public int getRate()
Returns:
the rate

setRate

public void setRate(int r)
Parameters:
rate - the rate to set, -10..10