Keywords: C, Node.js, FreeRTOS, ESP8266, Raspberry Pi, Speech Recognition, WiFi, MQTT
I wanted to play around with speech recognition on Raspberry Pi and decided to use the voice API released by IBM, Watson TJBot. There are several guides out there to get you started.
I already had my custom esp8266 RGBW lights (post futher down) controlled by a Raspberry Pi up and running at home. So instead from sending the commands over MQTT from the app, I wanted to send the same MQTT values using voice commands.
The already existing speech-to-text script used by TJBot takes a voice stream as input and gives a text string as output. So the only thing I had to do was to modify the script to look for my trigger words, for example lamp1, lamp2, on, off, blue, green, red and so on, and send MQTT commands to the lights on these triggers.
The source code for the speech recognition can be found on GitHub here. The source code for the esp8266 firmware is the same as in older post.
Demo on YouTube: