Continue to show how to make your cool Raspberry Pi projects even cooler with voice AI.
Building an end-to-end voice recognition:
Interested in building something similar to Alexa which understand commands such as "Alexa, turn on all the lights"? with a Raspberry Pi? You've come to the right place. Picovoice Platform SDK is what you're looking for. It consists [Porcupine Wake Word]https://picovoice.ai/platform/porcupine/) and Rhino Speech-to-Intent Engines.
In this demo we'll use Raspberry Pi Zero - ReSpeaker.
Let's get started!
Requirements
sudo apt-get install libasound2-dev
Access Key
If you don't have one, you can get your AccessKey from the Picovoice Console for free.
Run
gcc -std=c99 -O3 -o demo/respeaker-rpi0/picovoice_demo_mic \
-I sdk/c/include/ demo/respeaker-rpi0/picovoice_demo_mic.c \
-ldl -lasound
Say Picovoice
The demo outputs: [wake word]
Say turn on the lights
You should see the lights turned on and the following message in the terminal:
{
is_understood : 'true',
intent : 'turnLights',
slots : {
'state' : 'on',
}
}
Try changing the color by saying Picovoice, set the lights to orange
The list of commands you can try:
context:
expressions:
turnLights:
- "[switch, turn] $state:state (all) (the) [light, lights]"
- "[switch, turn] (all) (the) [light, lights] $state:state"
changeColor:
- "[change, set, switch] (all) (the) (light, lights) (color) (to) $color:color"
slots:
state:
- "off"
- "on"
color:
- "blue"
- "green"
- "orange"
- "pink"
- "purple"
- "red"
- "white"
- "yellow"
You can check out the GitHub repo to see more open-source demos
Top comments (0)