DEV Community

Dilek Karasoy for Picovoice

Posted on

Speech Recognition with STM32: Building hands-free voice experiences

On day 27, we'll build hands-free voice experience on an STM32 recognizing commands like:
Picovoice, turn on the light in the living room.
For this tutorial, we use the STM32F407 discovery board which costs $20.

Run the demo
You will need the dev board and STM32CubeIDE installed.

Clone the Picovoice repository.

git clone --recurse-submodules \
https://github.com/Picovoice/picovoice.git
Enter fullscreen mode Exit fullscreen mode

Open the project under /demo/mcu/stm32f407/ using STM32CubeIDE.

You need to download the audio middleware. Once downloaded, find the Middlewares folder and replace the empty Middlewares folder in the project with that.

Sign up for Picovoice Console for free and copy your AccessKey.

AccessKey
In main.c, insert your AccessKey string in the line:

static const char* ACCESS_KEY = ...
Enter fullscreen mode Exit fullscreen mode

Build and load the project into your board. The demo uses Serial Wire Viewer (SWV) to return log messages. Assure this works, and you can monitor it.

Say:
Picovoice, turn on the light in the living room
You should see the following in the debug console:

UID:  2c 00 55 00 13 51 37 34 34 37 33 32

[wake word]
{
    is_understood : 'true',
    intent : 'changeLightState',
    slots : {
        'state' : 'on',
        'location' : 'living room',
    }
}
Enter fullscreen mode Exit fullscreen mode

The UUID is the unique identifier of the ST MCU on the board. We will need it for training custom models. The rest shows that the firmware understood the wake phrase Picovoice using the Porcupine Wake Word engine, and the follow-on voice command turn on the light in the living room using Rhino Speech-to-Intent engine.

If you want to train a custom wake word and context you can continue to follow the steps in this tutorial

Top comments (0)