Package edu.tufts.hrilab.tts
Class MaryTTSComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.tts.MaryTTSComponent
- All Implemented Interfaces:
SpeechProductionInterface
,VoiceProsodyInterface
public final class MaryTTSComponent
extends DiarcComponent
implements SpeechProductionInterface, VoiceProsodyInterface
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.commons.cli.Option>
Command line options available in sub-class.void
addNewWord
(String word, byte[] pcmData) returns the current vocal emotiongetVoice()
protected void
init()
Perform any component initialization.boolean
Checks if speech is being produced.protected void
parseArgs
(org.apache.commons.cli.CommandLine cmdLine) Called directly after construction to pass runtime values that will override default values.boolean
Speaks appropriate text, blocking.boolean
Speaks appropriate textvoid
setEmotion
(String newEmo) sets prosody to STRESS ANGER or CONFUSIONvoid
boolean
Stops an ongoing utterance.Methods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
createInstance, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, shutdown, shutdownComponent
-
Constructor Details
-
MaryTTSComponent
MaryTTSComponent constructor. Initializes TTS component.
-
-
Method Details
-
init
protected void init()Description copied from class:DiarcComponent
Perform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.- Overrides:
init
in classDiarcComponent
-
isSpeaking
public boolean isSpeaking()Checks if speech is being produced.- Specified by:
isSpeaking
in interfaceSpeechProductionInterface
- Returns:
true
if speech is being produced,false
otherwise
-
stopUtterance
public boolean stopUtterance()Stops an ongoing utterance.- Specified by:
stopUtterance
in interfaceSpeechProductionInterface
- Returns:
true
if speech is interrupted,false
otherwise.
-
setEmotion
sets prosody to STRESS ANGER or CONFUSION- Specified by:
setEmotion
in interfaceVoiceProsodyInterface
- Parameters:
newEmo
- the new prosody to be used
-
getEmotion
returns the current vocal emotion- Specified by:
getEmotion
in interfaceVoiceProsodyInterface
-
getVoice
- Specified by:
getVoice
in interfaceVoiceProsodyInterface
- Returns:
- the current voice used for TTS
-
setVoice
- Specified by:
setVoice
in interfaceVoiceProsodyInterface
- Parameters:
v
- name of the voice or male or female
-
sayText
Description copied from interface:SpeechProductionInterface
Speaks appropriate text, blocking.- Specified by:
sayText
in interfaceSpeechProductionInterface
- Parameters:
text
- the text to be spoken
-
sayText
Speaks appropriate text- Specified by:
sayText
in interfaceSpeechProductionInterface
- Parameters:
text
- the text to be spokenwait
- whether or not to block until speaking call returns- Returns:
- true if the text was generated as speech, false otherwise
-
getConfigFile
-
addNewWord
-
getGuiHelp
-
additionalUsageInfo
Description copied from class:DiarcComponent
Command line options available in sub-class. This should be paired with a parseArgs implementation.- Overrides:
additionalUsageInfo
in classDiarcComponent
- Returns:
-
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Description copied from class:DiarcComponent
Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.zs- Overrides:
parseArgs
in classDiarcComponent
-