public class SpeechRecognitionHelper extends HelperBase
Then:
cd $PTII; ./configureSphinx works much better with a custom dictionary and language model. These can be generated from a file of sentences with an online tool. Please see: https://oss.sonatype.org/service/local/artifact/maven/redirect?r=releases&g=net.sf.phat&a=sphinx4-data&v=5prealpha&e=jar A sample dictionary, language model and sentence file from Sphinx4 are included with the demo: $PTII/ptolemy/actor/lib/jjs/modules/speechRecognition/demo/SpeechRecognition weather.dic, weather.lm and weather.samples
HelperBase.DATA_TYPE
_actor, _currentObj
Constructor and Description |
---|
SpeechRecognitionHelper(java.lang.Object actor,
jdk.nashorn.api.scripting.ScriptObjectMirror helping,
jdk.nashorn.api.scripting.ScriptObjectMirror options)
Construct a SpeechRecognitionHelper.
|
Modifier and Type | Method and Description |
---|---|
void |
setOptions(jdk.nashorn.api.scripting.ScriptObjectMirror options)
Set speech recognition options, including "continuous",
"dictionaryPath", and "languageModelPath".
|
void |
start()
Start speech recognition.
|
void |
stop()
Stop speech recognition.
|
_appendNumericToBuffer, _appendToBuffer, _error, _error, _error, _error, _extractFromBuffer, _issueResponse, _removeDuplicates, _sizeOfType, _toJavaBytes, _toJSArray, getHelping
public SpeechRecognitionHelper(java.lang.Object actor, jdk.nashorn.api.scripting.ScriptObjectMirror helping, jdk.nashorn.api.scripting.ScriptObjectMirror options) throws IllegalActionException
actor
- The PtolemyII actor associated with this helper.helping
- The Javascript object this helper is helping.IllegalActionException
public void setOptions(jdk.nashorn.api.scripting.ScriptObjectMirror options) throws IllegalActionException
options
- Speech recognition options, including
"continuous", "dictionaryPath" and "languageModelPath".IllegalActionException
- If the language or
dictionary files do not exist.public void start() throws IllegalActionException
IllegalActionException
public void stop()