Package edu.tufts.hrilab.asr.sphinx4
Class Sphinx4Component
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.asr.sphinx4.Sphinx4Component
- All Implemented Interfaces:
Sphinx4Interface
The implementation of an DIARCComponent with the Sphinx4 speech recognizer.
-
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 TypeMethodDescriptionvoidAccept last recognition result and pass to parser.protected List<org.apache.commons.cli.Option>Provides command line argument descriptions.voidClear recognition queue.get current control state, one of {CONFIRM, ACCEPT, REJECT}.Get the next recognition result from the recognition queue while in CONFIRM control state.protected voidinit()Perform any component initialization.protected voidparseArgs(org.apache.commons.cli.CommandLine cmdLine) Parses command line arguments specific to this DIARCComponent.voidReject last recognition result.voidvoidSet control state to one of {CONFIRM, ACCEPT, REJECT}.voidsetGrammar(String path) voidvoidMethods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
createInstance, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, shutdown, shutdownComponent
-
Constructor Details
-
Sphinx4Component
public Sphinx4Component()Constructor.- See Also:
-
-
Method Details
-
init
protected void init()Description copied from class:DiarcComponentPerform 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:
initin classDiarcComponent
-
setConfig
- Specified by:
setConfigin interfaceSphinx4Interface
-
setGrammar
- Specified by:
setGrammarin interfaceSphinx4Interface
-
setMixer
-
showMixerOptions
public void showMixerOptions() -
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Parses command line arguments specific to this DIARCComponent.- Overrides:
parseArgsin classDiarcComponent- Parameters:
cmdLine- The custom command line argumentsfalseotherwise
-
additionalUsageInfo
Provides command line argument descriptions.- Overrides:
additionalUsageInfoin classDiarcComponent- Returns:
- Command line argument switches and descriptions
-
setControlState
Description copied from interface:Sphinx4InterfaceSet control state to one of {CONFIRM, ACCEPT, REJECT}. GUI only method.- Specified by:
setControlStatein interfaceSphinx4Interface- Parameters:
state- one of {"CONFIRM", "ACCEPT", "REJECT"}
-
getControlState
Description copied from interface:Sphinx4Interfaceget current control state, one of {CONFIRM, ACCEPT, REJECT}. GUI only method.- Specified by:
getControlStatein interfaceSphinx4Interface
-
acceptUtterance
public void acceptUtterance()Description copied from interface:Sphinx4InterfaceAccept last recognition result and pass to parser. This is only for the CONFIRM control state.- Specified by:
acceptUtterancein interfaceSphinx4Interface
-
rejectUtterance
public void rejectUtterance()Description copied from interface:Sphinx4InterfaceReject last recognition result. This is only for the CONFIRM control state.- Specified by:
rejectUtterancein interfaceSphinx4Interface
-
getOnDeckText
Description copied from interface:Sphinx4InterfaceGet the next recognition result from the recognition queue while in CONFIRM control state.- Specified by:
getOnDeckTextin interfaceSphinx4Interface
-
clearRecogntionHistory
public void clearRecogntionHistory()Description copied from interface:Sphinx4InterfaceClear recognition queue. Only for use while in CONFIRM control state.- Specified by:
clearRecogntionHistoryin interfaceSphinx4Interface
-