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
  • Constructor Details

  • 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 class DiarcComponent
    • isSpeaking

      public boolean isSpeaking()
      Checks if speech is being produced.
      Specified by:
      isSpeaking in interface SpeechProductionInterface
      Returns:
      true if speech is being produced, false otherwise
    • stopUtterance

      public boolean stopUtterance()
      Stops an ongoing utterance.
      Specified by:
      stopUtterance in interface SpeechProductionInterface
      Returns:
      true if speech is interrupted, false otherwise.
    • setEmotion

      public void setEmotion(String newEmo)
      sets prosody to STRESS ANGER or CONFUSION
      Specified by:
      setEmotion in interface VoiceProsodyInterface
      Parameters:
      newEmo - the new prosody to be used
    • getEmotion

      public String getEmotion()
      returns the current vocal emotion
      Specified by:
      getEmotion in interface VoiceProsodyInterface
    • getVoice

      public String getVoice()
      Specified by:
      getVoice in interface VoiceProsodyInterface
      Returns:
      the current voice used for TTS
    • setVoice

      public void setVoice(String v)
      Specified by:
      setVoice in interface VoiceProsodyInterface
      Parameters:
      v - name of the voice or male or female
    • sayText

      public boolean sayText(String text)
      Description copied from interface: SpeechProductionInterface
      Speaks appropriate text, blocking.
      Specified by:
      sayText in interface SpeechProductionInterface
      Parameters:
      text - the text to be spoken
    • sayText

      public boolean sayText(String text, boolean wait)
      Speaks appropriate text
      Specified by:
      sayText in interface SpeechProductionInterface
      Parameters:
      text - the text to be spoken
      wait - whether or not to block until speaking call returns
      Returns:
      true if the text was generated as speech, false otherwise
    • getConfigFile

      public String getConfigFile()
    • addNewWord

      public void addNewWord(String word, byte[] pcmData)
    • getGuiHelp

      public String getGuiHelp()
    • additionalUsageInfo

      protected List<org.apache.commons.cli.Option> additionalUsageInfo()
      Description copied from class: DiarcComponent
      Command line options available in sub-class. This should be paired with a parseArgs implementation.
      Overrides:
      additionalUsageInfo in class DiarcComponent
      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 class DiarcComponent