Class Sphinx4Component

java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.sphinx4.Sphinx4Component
All Implemented Interfaces:
Sphinx4Interface

public class Sphinx4Component extends DiarcComponent implements Sphinx4Interface
The implementation of an DIARCComponent with the Sphinx4 speech recognizer.
  • 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
    • setConfig

      public void setConfig(String path)
      Specified by:
      setConfig in interface Sphinx4Interface
    • setGrammar

      public void setGrammar(String path)
      Specified by:
      setGrammar in interface Sphinx4Interface
    • setMixer

      public void setMixer(String ID)
    • showMixerOptions

      public void showMixerOptions()
    • parseArgs

      protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine)
      Parses command line arguments specific to this DIARCComponent.
      Overrides:
      parseArgs in class DiarcComponent
      Parameters:
      cmdLine - The custom command line arguments false otherwise
    • additionalUsageInfo

      protected List<org.apache.commons.cli.Option> additionalUsageInfo()
      Provides command line argument descriptions.
      Overrides:
      additionalUsageInfo in class DiarcComponent
      Returns:
      Command line argument switches and descriptions
    • setControlState

      public void setControlState(Sphinx4Component.ControlState state)
      Description copied from interface: Sphinx4Interface
      Set control state to one of {CONFIRM, ACCEPT, REJECT}. GUI only method.
      Specified by:
      setControlState in interface Sphinx4Interface
      Parameters:
      state - one of {"CONFIRM", "ACCEPT", "REJECT"}
    • getControlState

      public Sphinx4Component.ControlState getControlState()
      Description copied from interface: Sphinx4Interface
      get current control state, one of {CONFIRM, ACCEPT, REJECT}. GUI only method.
      Specified by:
      getControlState in interface Sphinx4Interface
    • acceptUtterance

      public void acceptUtterance()
      Description copied from interface: Sphinx4Interface
      Accept last recognition result and pass to parser. This is only for the CONFIRM control state.
      Specified by:
      acceptUtterance in interface Sphinx4Interface
    • rejectUtterance

      public void rejectUtterance()
      Description copied from interface: Sphinx4Interface
      Reject last recognition result. This is only for the CONFIRM control state.
      Specified by:
      rejectUtterance in interface Sphinx4Interface
    • getOnDeckText

      public String getOnDeckText()
      Description copied from interface: Sphinx4Interface
      Get the next recognition result from the recognition queue while in CONFIRM control state.
      Specified by:
      getOnDeckText in interface Sphinx4Interface
    • clearRecogntionHistory

      public void clearRecogntionHistory()
      Description copied from interface: Sphinx4Interface
      Clear recognition queue. Only for use while in CONFIRM control state.
      Specified by:
      clearRecogntionHistory in interface Sphinx4Interface