YerkoPalma / choo-stt

:microphone: Simple speech-to-text in the browser for choo
MIT License
13 stars 3 forks source link

Extend API #1

Closed YerkoPalma closed 6 years ago

YerkoPalma commented 7 years ago

Right now this module only wrap what is actually offered (and a bit less) by SpeechRecognition API. Now what seems like a natural addition is the capability to define commands like annyang does. Now I'm not sure if we should keep it minimalistic or got for the commands API.

If we go to, it should be like this

// <command name with named parameters>, callback the listened parameters
emit('stt:set-command', 'command :name', callback(name))

The callback will run when a listened speech fits in the command definition