Simple voice controlled smart home stack with python and nodeJS
- Audio file upload
- Audio file can be used as input for the voice recognition
- Working on a HTML5 application which records audio and uploads it to the backend
- Some linux packages
- Python 2.7
- NodeJS
- Sphinxbase
- Pocketsphinx
- Dictionary and Languagemodel for Sphinx
Needed linux packages
sudo apt-get install python-dev python-pyaudio libasound2-dev libtool autoconf python libpulse-dev swig bison
Installation of Sphinxbase
$ git clone https://github.com/cmusphinx/sphinxbase
$ cd sphinxbase
$ ./autogen.sh
$ ./configure
$ sudo make
$ sudo make check
$ sudo make install
Installation of Pocketsphinx
$ git clone https://github.com/cmusphinx/pocketsphinx
$ cd pocketsphinx
$ ./autogen.sh
$ ./configure --enable-fixed
$ sudo make check
$ sudo make install
Dictionary and Languagemodel for Sphinx
Sphinx needs at least a dictionary (.dic) and a language model (.lm) file to validate your audio imput. You can create those file here If you have created your dictionary and language model, specify the location of those files in the pihome.conf file. Otherwise you will get the following error message after runnning the python script pihome.py:
- RuntimeError: new_Decoder returned -1
First of all install all needed dependencies for Python and node:
- Python dependencies
sudo pip install -r requirements.txt
- NodeJS dependencies
cd backend
npm install
Now test if everything works fine by starting the pihome.py python script and the server.js nodeJS backend in seperate terminals
- Python script
python pihome.py
- NodeJS backend
node server.js