|
Version1 /
Speech Recognition ModuleConvert speech to text with this module! Currently, only live speech is supported. Recorded speech could be a future enhancement. CapeCode requires a library file download (due to size) and generally requires an additional custom dictionary file for acceptable accuracy. Please see the CapeCode Setup and Customization sections. Speech recognition is the first step in a user interaction strategy. The area of Natural Language Understanding further investigates inferring intent from speech. Functions
Events
UsageFirst, require the module and create a new speech recognition object. var speechRecognition = require('@accessors-modules/speech-recognition');
var options = {};
options.continuous = true; // If you would like continuous recognition
var recognition = new speechRecognition.SpeechRecognition(options);
Set up an event listener for results, then start the recognizer. For example, to send results to an output named var self = this;
recognition.on('result', function(result) {
self.send('output', result);
});
recognition.start();
CapeCode SetupCapeCode uses CMU Sphinx4 for recognition. The library .jar files are around 35MB total, which is a bit large to check in to the repository. To install Sphinx4:
If you have problems, then build Sphinx4 from source:
CustomizationCapeCode uses CMU Sphinx4 which performs much better with a custom dictionary and language model. CMU offers a free online tool for generating these. You'll need a file with sentences for your application, one sentence per line. For example, see Navigate to: http://www.speech.cs.cmu.edu/tools/lmtool-new.html Lmtool will generate some files. Copy the Back to Optional JavaScript Modules |