The node.js code has only a few lines and is easy to understand. It uses pocketsphinx to recognize speech commands and speech-dispatcher to answer.
- A machine that runs Experimental Platform
- A microphone, we used this
- A speaker, we used this
Make sure the microphone is plugged in before you deploy the code.
git clone https://github.com/experimental-platform/example-voice-recognition.git
cd example-voice-recognition
git remote add platform ssh://dokku@your-box.local:8022/example-voice-recognition
git push platform master
If you want to use different audio input and output than the default ones (typically the first ones to be connected to the system, like integrated audio card) then you need to use pactl
to switch the default sink and/or source.
pactl list sinks
and pactl list sources
will list the outputs and inputs respectively.
pactl set-default-sink <sink name>
and pactl set-default-source <source name>
will switch the default output and input used by PulseAudio.
You might also need to use alsamixer
to ramp up the volume of your devices.
Add your word to the dictionary file and check if the word is included in the stdout of pocketsphinx.