public class ALSpeechRecognition extends ALProxy
Constructor and Description |
---|
ALSpeechRecognition(Session session) |
Modifier and Type | Method and Description |
---|---|
void |
activateAllRules(java.lang.String contextName)
Activate all rules contained in the specified context.
|
void |
activateRule(java.lang.String contextName,
java.lang.String ruleName)
Activate a rule contained in the specified context.
|
void |
addContext(java.lang.String pathToLCFFile,
java.lang.String contextName)
Add a context from a LCF file.
|
void |
addWordListToSlot(java.lang.String contextName,
java.lang.String slotName,
java.util.List<java.lang.String> wordList)
Add a list of words in a slot.
|
void |
clearStats() |
void |
compile(java.lang.String param1,
java.lang.String param2,
java.lang.String param3) |
void |
deactivateAllRules(java.lang.String contextName)
Deactivate all rules contained in the specified context.
|
void |
deactivateRule(java.lang.String contextName,
java.lang.String ruleName)
Deactivate a rule contained in the specified context.
|
void |
eraseContextSet(java.lang.String saveName)
Erase a saved context set of the speech recognition engine
|
void |
exit()
Exits and unregisters the module.
|
java.lang.Boolean |
getAudioExpression()
To check if audio expression is enabled or disabled.
|
java.util.List<java.lang.String> |
getAvailableLanguages()
Returns the list of the languages installed on the system.
|
java.lang.String |
getBrokerName()
Gets the name of the parent broker.
|
java.lang.Float |
getContextParam(java.lang.String contextName,
java.lang.String paramName)
Get the given parameter for the specified context.
|
java.lang.Integer |
getCurrentPeriod()
Gets the current period.
|
java.lang.Float |
getCurrentPrecision()
Gets the current precision.
|
java.util.List<java.lang.String> |
getEventList()
Get the list of events updated in ALMemory.
|
java.lang.String |
getLanguage()
Returns the current language used by the speech recognition system.
|
java.util.List<java.lang.String> |
getMemoryKeyList()
Get the list of events updated in ALMemory.
|
java.lang.Object |
getMethodHelp(java.lang.String methodName)
Retrieves a method's description.
|
java.util.List<java.lang.String> |
getMethodList()
Retrieves the module's method list.
|
java.lang.Object |
getModuleHelp()
Retrieves the module's description.
|
java.lang.Integer |
getMyPeriod(java.lang.String name)
Gets the period for a specific subscription.
|
java.lang.Float |
getMyPrecision(java.lang.String name)
Gets the precision for a specific subscription.
|
java.util.List<java.lang.String> |
getOutputNames()
Get the list of values updated in ALMemory.
|
java.lang.Float |
getParameter(java.lang.String paramName)
Gets a parameter of the speech recognition engine.
|
java.util.List<java.lang.String> |
getRules(java.lang.String contextName,
java.lang.String typeName)
Get all rules contained for a specific context.
|
java.lang.Object |
getSubscribersInfo()
Gets the parameters given by the module.
|
java.lang.String |
getUsage(java.lang.String name)
Gets the method usage string.
|
java.lang.Boolean |
isRunning(java.lang.Integer id)
Returns true if the method is currently running.
|
java.lang.Boolean |
isStatsEnabled() |
java.lang.Boolean |
isTraceEnabled() |
void |
loadContextSet(java.lang.String saveName)
Load a saved context set of the speech recognition engine
|
void |
loadVocabulary(java.lang.String vocabularyFile)
Loads the vocabulary to recognized contained in a .lxd file.
|
void |
pause(java.lang.Boolean pause)
Stops and restarts the speech recognition engine according to the input parameter This can be used to add contexts, activate or deactivate rules of a contex, add a words to a slot.
|
java.lang.Boolean |
ping()
Just a ping.
|
void |
popContexts()
Disable current contexts and restore saved contexts of the speech recognition engine.
|
void |
pushContexts()
Disable current contexts of the speech recognition engine and save them in a stack.
|
void |
removeAllContext()
Remove all contexts from the speech recognition engine.
|
void |
removeContext(java.lang.String contextName)
Remove one context from the speech recognition engine.
|
void |
removeWordListFromSlot(java.lang.String contextName,
java.lang.String slotName)
Remove all words from a slot.
|
java.lang.Boolean |
saveContextSet(java.lang.String saveName)
Save current context set of the speech recognition engine
|
void |
setAudioExpression(java.lang.Boolean setOrNot)
Enables or disables the playing of sounds indicating the state of the recognition engine.
|
void |
setContextParam(java.lang.String contextName,
java.lang.String paramName,
java.lang.Float value)
Set the given parameter for the specified context.
|
void |
setLanguage(java.lang.String languageName)
Sets the language used by the speech recognition engine.
|
void |
setParameter(java.lang.String paramName,
java.lang.Boolean paramValue)
Sets a parameter of the speech recognition engine.
|
void |
setParameter(java.lang.String paramName,
java.lang.Float paramValue)
Sets a parameter of the speech recognition engine.
|
void |
setVisualExpression(java.lang.Boolean setOrNot)
Enables or disables the leds animations showing the state of the recognition engine during the recognition process.
|
void |
setVisualExpressionMode(java.lang.Integer mode)
Sets the LED animation mode
|
void |
setVocabulary(java.util.List<java.lang.String> vocabulary,
java.lang.Boolean enabledWordSpotting)
Sets the list of words (vocabulary) that should be recognized by the speech recognition engine.
|
void |
setWordListAsVocabulary(java.util.List<java.lang.String> vocabulary)
Sets the list of words (vocabulary) that should be recognized by the speech recognition engine.
|
void |
stop(java.lang.Integer id)
returns true if the method is currently running
|
void |
subscribe(java.lang.String name)
Subscribes to the extractor.
|
void |
subscribe(java.lang.String name,
java.lang.Integer period,
java.lang.Float precision)
Subscribes to the extractor.
|
void |
unsubscribe(java.lang.String name)
Unsubscribes from the extractor.
|
void |
updatePeriod(java.lang.String name,
java.lang.Integer period)
Updates the period if relevant.
|
void |
updatePrecision(java.lang.String name,
java.lang.Float precision)
Updates the precision if relevant.
|
java.lang.String |
version()
Returns the version of the module.
|
java.lang.Boolean |
wait(java.lang.Integer id,
java.lang.Integer timeoutPeriod)
Wait for the end of a long running method that was called using 'post'
|
call, connect, connect, disconnect, getNaoqiType, getService, isProxyReady, setService
public ALSpeechRecognition(Session session) throws java.lang.Exception
java.lang.Exception
public java.lang.String getLanguage() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void setWordListAsVocabulary(java.util.List<java.lang.String> vocabulary) throws CallError, java.lang.InterruptedException
vocabulary
- List of words that should be recognizedCallError
java.lang.InterruptedException
public void setAudioExpression(java.lang.Boolean setOrNot) throws CallError, java.lang.InterruptedException
setOrNot
- Enable (true) or disable it (false).CallError
java.lang.InterruptedException
public void pause(java.lang.Boolean pause) throws CallError, java.lang.InterruptedException
pause
- Boolean to enable or disable pause of the speech recognition engine.CallError
java.lang.InterruptedException
public void compile(java.lang.String param1, java.lang.String param2, java.lang.String param3) throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void setLanguage(java.lang.String languageName) throws CallError, java.lang.InterruptedException
languageName
- Name of the language in English.CallError
java.lang.InterruptedException
public void removeContext(java.lang.String contextName) throws CallError, java.lang.InterruptedException
contextName
- Name of the context to remove from the speech recognition engine.CallError
java.lang.InterruptedException
public void removeAllContext() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void pushContexts() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void popContexts() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean saveContextSet(java.lang.String saveName) throws CallError, java.lang.InterruptedException
saveName
- Name under which to saveCallError
java.lang.InterruptedException
public void eraseContextSet(java.lang.String saveName) throws CallError, java.lang.InterruptedException
saveName
- Name under which the context set is savedCallError
java.lang.InterruptedException
public void activateRule(java.lang.String contextName, java.lang.String ruleName) throws CallError, java.lang.InterruptedException
contextName
- Name of the context to modify.ruleName
- Name of the rule to activate.CallError
java.lang.InterruptedException
public void deactivateRule(java.lang.String contextName, java.lang.String ruleName) throws CallError, java.lang.InterruptedException
contextName
- Name of the context to modify.ruleName
- Name of the rule to deactivate.CallError
java.lang.InterruptedException
public void activateAllRules(java.lang.String contextName) throws CallError, java.lang.InterruptedException
contextName
- Name of the context to modify.CallError
java.lang.InterruptedException
public void deactivateAllRules(java.lang.String contextName) throws CallError, java.lang.InterruptedException
contextName
- Name of the context to modify.CallError
java.lang.InterruptedException
public void setContextParam(java.lang.String contextName, java.lang.String paramName, java.lang.Float value) throws CallError, java.lang.InterruptedException
contextName
- Name of the contextparamName
- Name of the parameter to changevalue
- New parameter valueCallError
java.lang.InterruptedException
public java.lang.Float getContextParam(java.lang.String contextName, java.lang.String paramName) throws CallError, java.lang.InterruptedException
contextName
- Name of the contextparamName
- Name of the parameter to getCallError
java.lang.InterruptedException
public void addWordListToSlot(java.lang.String contextName, java.lang.String slotName, java.util.List<java.lang.String> wordList) throws CallError, java.lang.InterruptedException
contextName
- Name of the context to modify.slotName
- Name of the slot to modify.wordList
- List of words to insert in the slot.CallError
java.lang.InterruptedException
public void removeWordListFromSlot(java.lang.String contextName, java.lang.String slotName) throws CallError, java.lang.InterruptedException
contextName
- Name of the context to modify.slotName
- Name of the slot to modify.CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getRules(java.lang.String contextName, java.lang.String typeName) throws CallError, java.lang.InterruptedException
contextName
- Name of the context to analyze.typeName
- Type of the required rules.CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getAvailableLanguages() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void loadVocabulary(java.lang.String vocabularyFile) throws CallError, java.lang.InterruptedException
vocabularyFile
- Name of the lxd file containing the vocabularyCallError
java.lang.InterruptedException
public void setParameter(java.lang.String paramName, java.lang.Float paramValue) throws CallError, java.lang.InterruptedException
paramName
- Name of the parameter.paramValue
- Value of the parameter.CallError
java.lang.InterruptedException
public java.lang.Boolean getAudioExpression() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void setParameter(java.lang.String paramName, java.lang.Boolean paramValue) throws CallError, java.lang.InterruptedException
paramName
- Name of the parameter.paramValue
- Value of the parameter.CallError
java.lang.InterruptedException
public java.lang.Float getParameter(java.lang.String paramName) throws CallError, java.lang.InterruptedException
paramName
- Name of the parameter.CallError
java.lang.InterruptedException
public void setVocabulary(java.util.List<java.lang.String> vocabulary, java.lang.Boolean enabledWordSpotting) throws CallError, java.lang.InterruptedException
vocabulary
- List of words that should be recognizedenabledWordSpotting
- If disabled, the engine expects to hear one of the specified words, nothing more, nothing less. If enabled, the specified words can be pronounced in the middle of a whole speech stream, the engine will try to spot them.CallError
java.lang.InterruptedException
public void loadContextSet(java.lang.String saveName) throws CallError, java.lang.InterruptedException
saveName
- Name under which the context set is savedCallError
java.lang.InterruptedException
public void addContext(java.lang.String pathToLCFFile, java.lang.String contextName) throws CallError, java.lang.InterruptedException
pathToLCFFile
- Path to a LCF file. This LCF file contains the set of rules that should be recognized by the speech recognition engine.contextName
- Name of the context of your choice.CallError
java.lang.InterruptedException
public java.lang.Boolean isStatsEnabled() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void clearStats() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean isTraceEnabled() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void exit() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.String version() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean ping() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getMethodList() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Object getMethodHelp(java.lang.String methodName) throws CallError, java.lang.InterruptedException
methodName
- The name of the method.CallError
java.lang.InterruptedException
public java.lang.Object getModuleHelp() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean wait(java.lang.Integer id, java.lang.Integer timeoutPeriod) throws CallError, java.lang.InterruptedException
id
- The ID of the method that was returned when calling the method using 'post'timeoutPeriod
- The timeout period in ms. To wait indefinately, use a timeoutPeriod of zero.CallError
java.lang.InterruptedException
public java.lang.Boolean isRunning(java.lang.Integer id) throws CallError, java.lang.InterruptedException
id
- The ID of the method that was returned when calling the method using 'post'CallError
java.lang.InterruptedException
public void stop(java.lang.Integer id) throws CallError, java.lang.InterruptedException
id
- the ID of the method to wait forCallError
java.lang.InterruptedException
public java.lang.String getBrokerName() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.String getUsage(java.lang.String name) throws CallError, java.lang.InterruptedException
name
- The name of the method.CallError
java.lang.InterruptedException
public void subscribe(java.lang.String name, java.lang.Integer period, java.lang.Float precision) throws CallError, java.lang.InterruptedException
name
- Name of the module which subscribes.period
- Refresh period (in milliseconds) if relevant.precision
- Precision of the extractor if relevant.CallError
java.lang.InterruptedException
public void subscribe(java.lang.String name) throws CallError, java.lang.InterruptedException
name
- Name of the module which subscribes.CallError
java.lang.InterruptedException
public void unsubscribe(java.lang.String name) throws CallError, java.lang.InterruptedException
name
- Name of the module which had subscribed.CallError
java.lang.InterruptedException
public void updatePeriod(java.lang.String name, java.lang.Integer period) throws CallError, java.lang.InterruptedException
name
- Name of the module which has subscribed.period
- Refresh period (in milliseconds).CallError
java.lang.InterruptedException
public void updatePrecision(java.lang.String name, java.lang.Float precision) throws CallError, java.lang.InterruptedException
name
- Name of the module which has subscribed.precision
- Precision of the extractor.CallError
java.lang.InterruptedException
public java.lang.Integer getCurrentPeriod() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Float getCurrentPrecision() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Integer getMyPeriod(java.lang.String name) throws CallError, java.lang.InterruptedException
name
- Name of the module which has subscribed.CallError
java.lang.InterruptedException
public java.lang.Float getMyPrecision(java.lang.String name) throws CallError, java.lang.InterruptedException
name
- name of the module which has subscribedCallError
java.lang.InterruptedException
public java.lang.Object getSubscribersInfo() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getOutputNames() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getEventList() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getMemoryKeyList() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void setVisualExpression(java.lang.Boolean setOrNot) throws CallError, java.lang.InterruptedException
setOrNot
- Enable (true) or disable it (false).CallError
java.lang.InterruptedException
Aldebaran SDK for Java
Copyright 2006-2015 Aldebaran Robotics. All Rights Reserved.