Package edu.tufts.hrilab.sphinx4
Class Sphinx4Component
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.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 TypeMethodDescriptionvoid
Accept last recognition result and pass to parser.protected List<org.apache.commons.cli.Option>
Provides command line argument descriptions.void
Clear 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 void
init()
Perform any component initialization.protected void
parseArgs
(org.apache.commons.cli.CommandLine cmdLine) Parses command line arguments specific to this DIARCComponent.void
Reject last recognition result.void
void
Set control state to one of {CONFIRM, ACCEPT, REJECT}.void
setGrammar
(String path) void
void
Methods 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: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
-
setConfig
- Specified by:
setConfig
in interfaceSphinx4Interface
-
setGrammar
- Specified by:
setGrammar
in 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:
parseArgs
in classDiarcComponent
- Parameters:
cmdLine
- The custom command line argumentsfalse
otherwise
-
additionalUsageInfo
Provides command line argument descriptions.- Overrides:
additionalUsageInfo
in classDiarcComponent
- Returns:
- Command line argument switches and descriptions
-
setControlState
Description copied from interface:Sphinx4Interface
Set control state to one of {CONFIRM, ACCEPT, REJECT}. GUI only method.- Specified by:
setControlState
in interfaceSphinx4Interface
- Parameters:
state
- one of {"CONFIRM", "ACCEPT", "REJECT"}
-
getControlState
Description copied from interface:Sphinx4Interface
get current control state, one of {CONFIRM, ACCEPT, REJECT}. GUI only method.- Specified by:
getControlState
in interfaceSphinx4Interface
-
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 interfaceSphinx4Interface
-
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 interfaceSphinx4Interface
-
getOnDeckText
Description copied from interface:Sphinx4Interface
Get the next recognition result from the recognition queue while in CONFIRM control state.- Specified by:
getOnDeckText
in interfaceSphinx4Interface
-
clearRecogntionHistory
public void clearRecogntionHistory()Description copied from interface:Sphinx4Interface
Clear recognition queue. Only for use while in CONFIRM control state.- Specified by:
clearRecogntionHistory
in interfaceSphinx4Interface
-