Simple Google Assistant with hotword activation from Snowboy setup for my Pi Zero W.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
models First commit Apr 30, 2017
resources First commit Apr 30, 2017
.gitignore First commit Apr 30, 2017
LICENSE Create LICENSE Jan 16, 2018
README.md Added Snowboy for Python 3; Updated for latest SDK; Updated README.md; Aug 30, 2017
_snowboydetect.so
_snowboydetect.so_py3
assistant.py
gassistant.py First commit Apr 30, 2017
snowboydecoder.py
snowboydetect.py First commit Apr 30, 2017

README.md

google-assistant-hotword-raspi

Simple Google Assistant with hotword activation from Snowboy setup for RaspberryPi 1 and Zero W.

Setup

1. Google Assistant Python setup on Raspbery Pi

  • Configure a Developer Project and Account Settings
  • Configure and Test the Audio
  • 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
    
  • Install dependencies sudo apt-get install portaudio19-dev libffi-dev libssl-dev
  • Install Google Assistant SDK + Samples python -m pip install google-assistant-sdk[samples]
  • Get credentials 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
  • Test using the sample 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.

2. Snowboy Python setup on Pi - Github

  • (Optional - The required files are already in this repo) Download Snowboy compiled library for all versions of Pi + demo
  • Install dependencies sudo apt-get install python-pyaudio python3-pyaudio sox
  • Install BLAS sudo apt-get install libatlas-base-dev
  • Install PyAudio 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.

Train your own hotwords or download existing ones from https://snowboy.kitt.ai/

3. Run gassistant.py and you should have a working Google Assistant with hotword activation

`python gassistant.py models/ok_google.pmdl`