a bot which listens and says non sense in several languages
$ npm i
$ npm start linux release
or
$ npm start raspi release
on a raspberry:
$ sudo apt-get install gcc libasound2 libasound2-dev
$ sudo apt-get install mpg321
vi node_modules/speech-stream/node_modules/mespeak/src/index.js
orvi node_modules/mespeak/src/index.js
then
replace
var ESpeak = require("./ESPEAK.js")
with
var ESpeak = require("./ESpeak.js")
Needs pocketsphinx installed and configured, which is not an easy task.
Specific to raspberry:
- the instructions for raspberry pi
- find the missing file alsa-base.conf (use the comment about
/lib/modprobe.d/aliases.conf
) - this post about trouble shooting mic/audio and this one too
My parent folder looks like this
- openfst
- phonetisaurus
- Phonetisaurus
- pocketsphinx
- pocketsphinx-python
- sphinxbase
- marcel
Use this tool to chose words to be recognized (optional but much more efficient)
- http://www.speech.cs.cmu.edu/tools/lmtool-new.html
- also see http://www.speech.cs.cmu.edu/sphinx/models/
Then use npm run listen:sentences
in index.js
Here are foreign language packs: http://www.politepix.com/languages
Convert *.lm.dmp to *.lm (very slow) (from this tutorial)
sphinx_lm_convert -i ../fr/fr.lm.dmp -ifmt bin -o ../fr/model.lm -ofmt arpa
Convert to .bin (quicker to start)
sphinx_lm_convert -i model.lm -o model.lm.bin
- activate between "marcel" and "shut up marcel"
- switch between languages
- repeat mode
- record / play sound
- play radio
- give the time, set timer
- search duckduckgo instant answers