Close

The Main VoiceBox Server

A project log for VoiceBox

Adding a Flask web interface (and other stuff) to the Google AIY Voice Kit.

tmTM 08/05/2018 at 20:170 Comments

I've been stalling on posting about the main VoiceBox (Google Assistant + Flask) server as it's still a work in progress. Rather than drag my feet any longer, I'm going to put up the code and run through the main structure and features. I'll expand on different parts of the functionality, like music playing or controlling esp8266 devices, in later log posts.

The VoiceBox root menu, visible at <your-Pi's-address>:9011. From here you can switch between "hotword" mode (where the Assistant is listening all the time for "Hey Google", or "Okay Google"), and "button" mode (where the Assistant starts listening when the button is pressed - and bell wrung).

You can, of course, switch modes verbally by saying "Hey Google, button mode" or <press button>"hotword mode".

The "Ask a Question" page is a bit of a work in progress. At present whatever you type is passed straight to the Google Assistant for processing. Unfortunately, I can't think of a clean way to have local processing performed before handing the query to the Google Cloud.

I'll upload the source now and go over the program structure in a separate post. Download VoiceBox.zip and unzip into /home/pi/AIY-projects-python/src. If running manually, you'll have to us the "Start dev terminal" link on the Pi desktop to load the correct environment. From there, type src/VOICEBox/VoiceBox.py, and the program will be run via python3 with AIY libraries installed.

You may get warnings about imports being "not found". I'll post a separate log on what needs to be installed when I feel guilty enough to use the stack of SD cards I bought to re-create the process from scratch.

Discussions