Simple Google Assistant with hotword activation from Snowboy setup for RaspberryPi 1 and Zero W.
Setup virtual environment
- (Recommended) For Python 3:
sudo apt-get update
sudo apt-get install python3-dev python3-venv
python3 -m venv env
env/bin/python -m pip install pip setuptools --upgrade
source env/bin/activate
- For Python 2:
sudo apt-get update
sudo apt-get install python-dev python-virtualenv
virtualenv env --no-site-packages
env/bin/pip install pip setuptools --upgrade
source env/bin/activate
sudo apt-get install portaudio19-dev libffi-dev libssl-dev
python -m pip install google-assistant-sdk[samples]
pip install --upgrade google-auth-oauthlib[tool]
google-oauthlib-tool --client-secrets path/to/client_secret_XXXXX.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless
python -m googlesamples.assistant
Issue commands after pressing enter
and if you did all the steps above Google Assistant should respond.PS On Raspberry Pi Zero W this setup takes about 30-40 minutes.
sudo apt-get install python-pyaudio python3-pyaudio sox
sudo apt-get install libatlas-base-dev
pip install pyaudio
You should be able to recored audio using:
rec temp.wav
PS For Python 3 rename _snowboydetect.so_py3
to _snowboydetect.so
.
gassistant.py
and you should have a working Google Assistant with hotword activation`python gassistant.py models/ok_google.pmdl`