This repository contains a way to use a custom hotword with google assistant.
It demonstrates: - Initialization of the Assistant - Basic event handling including hotword detection.
linux-arm7l
SBC)Install Python 3
Ubuntu/Debian GNU/Linux:
sudo apt-get update sudo apt-get install python3 python3-venv
Create a new virtual environment (recommended):
python3 -m venv env
env/bin/python -m pip install --upgrade pip setuptools
source env/bin/activate
Download the client_secret_XXXXX.json
file from the Google API Console Project credentials section and generate credentials using google-oauth-tool
:
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
Install the sample dependencies using pip:
pip install --upgrade -r requirements.txt
Run the hotword sample. The sample waits for the “Ok Google” hotword, then records a voice query and plays back the Google Assistant’s answer:
python -m hotword
If that works, execute:
python3 -m jarvis
If audio is not working, verify the ALSA setup:
# Play a test sound
speaker-test -t wav
# Record and play back some audio using ALSA command-line tools
arecord --format=S16_LE --duration=5 --rate=16k --file-type=raw out.raw
aplay --format=S16_LE --rate=16k --file-type=raw out.raw
See also the troubleshooting section of the official documentation.
Copyright (C) 2017 Google Inc, Kitt_ai And aycgit
See the LICENCE file distributed with this work for additional information regarding copyright ownership.