AIY like Voice Recognition and Control using Google Cloud Speech API on a NextThingCo CHIP SBC

 NextThingCo C.H.I.P  Comments Off on AIY like Voice Recognition and Control using Google Cloud Speech API on a NextThingCo CHIP SBC
Jun 282017
 

In our previous post we showed you how to use a Raspberry Pi and a USB audio adapter to make a MAX9812 room mic that can listen out for commands and read out the news, share prices, weather, time and turn an LED on or off. This is basically the same thing, but with the mic wired directly to the CHIP’s Mic in port.

The software listens out for the keyword “Oscar”. Once it hears the keyword it then listens out for the words “News, Weather, Shares, Light On, Light Off or Time”.

If you want to control an LED using the “Light On” or “Light Off” commands, then you need to wire this up too:

The full PDF instructions (2 pages A4) http://www.securipi.co.uk/vrchip.pdf

Software ZIP file http://www.securipi.co.uk/vrchip.zip

You can buy a £9.99 kit of the Mic, breadboard, cables and components at http://www.ebay.co.uk/itm/Voice-Recognition-kit-for-Google-Cloud-Speech-API-AIY-on-Pocket-Chip-C-H-I-P-/162594971425? (we ship worldwide)

 Posted by at 9:05 am

Voice Recognition and Command with a Raspberry Pi and Google Cloud Speech API

 Raspberry Pi  Comments Off on Voice Recognition and Command with a Raspberry Pi and Google Cloud Speech API
Jun 192017
 

Plug in a USB microphone

Increase mic volume for USB device to full using

alsamixer

Screenshot - 150617 - 11:14:09

(F6 to change to USB device and arrow keys move across to Mic and up arrow increases volume to full, Esc to quit)

Make a test recording:

arecord -D plughw:1,0 -f S16_LE test.wav

CTRL-C to quit

aplay test.wav

Sign up to Google cloud platform for free

https://console.cloud.google.com/start

google-cloud

Google Cloud Speech API -> go to Credenitials tab -> Create Credentials -> API Key -> cut and paste your API key for use in speechAnalyser.py later

sudo apt-get install mplayer

sudo apt-get install sox

sudo apt-get install flac

sudo apt-get install python-pycurl

sudo apt-get install python-pip

sudo pip install feedparser

sudo pip install yahoo-finance

search for stock/share symbols at https://uk.finance.yahoo.com/lookup/ and edit getShares.py to suit.
while in folder /home/pi pull ZIP file from our server with

wget www.securipi.co.uk/vr.zip

unzip vr.zip

chmod a+x speech.sh

edit speechAnalyser.py so it contains your Google Cloud Speech API key

nano speechAnalyser.py

save it and exit

run it while connected to the internet

python speechAnalyser.py

say the trigger word “oscar”, wait for a beep, and then say either “news, weather, shares, time, light on, light off, flatter me”

(light on & light off control a red LED with a 220 ohm resistor connected to GPIO4 and GND pins)

You can make a really good room mic, with 15 feet range, using a USB audio adapter and a MAX9812 amplified microphone (cost about £5 for both items on eBay)

usb-mic

You can download our 3D print case design from

http://www.securipi.co.uk/usb-mic-holder.stl

usb-mic-case

Use a hot-glue gun to secure the boards in place.

http://www.securipi.co.uk/vr.pdf
http://www.securipi.co.uk/vr.zip

With thanks to these web pages:

https://randomconsultant.blogspot.co.uk/2017/01/building-amazon-echo-like-device-with.html
and
https://pypi.python.org/pypi/yahoo-finance

 Posted by at 8:13 am