Day 1: No-code Offline Voice Assistant

dilek

Dilek Karasoy

Posted on December 25, 2022

Day 1: No-code Offline Voice Assistant

For the next 100 days, we'll share some tutorials and tips to build voice products. Let's start with an easy one, that requires no prior machine learning or coding skills.

Picovoice Shepherd is the first no-code platform for building voice interfaces on microcontrollers. It enables creating voice experiences similar to Alexa, except that they run entirely on-device, instead of in the cloud. Picovoice Shepherd accelerates prototyping, mitigates technical risks, and shortens time-to-market. Paired with Picovoice Console, users can deploy custom voice models onto microcontrollers instantly.

Requirements

Python 3

Compatibility

Linux (x86_64)
macOS (x86_64)
Windows (x86_64)

Installation

Install Picovoice Shepherd via PIP:

pip3 install pvshepherd
Enter fullscreen mode Exit fullscreen mode

Usage
Run the following command from the terminal:

pvshepherd
Enter fullscreen mode Exit fullscreen mode

Upload the Picovoice Firmware

  • Select your board from the list. Make sure that the board is connected to the computer.
  • Press the Upload Firmware button and wait for the operation to conclude.

Upload the Default Models

The unique universal identifier (UUID) of microcontroller on the board is at the top. You need this UUID to create custom models using Picovoice Console. For now, let's continue with the default models. Upload the default voice models to the board by pressing Use Default Models.

Test the Default Models

The board is ready. It has started processing the audio input from the microphone in real-time. It writes to the Shepherd console when the Picovoice engine detects utterances of the given wake word and follow-on voice commands. Say:

Picovoice, turn the lights on

Picovoice will detect the occurrence of the default wake word ("Picovoice"), and then determines the intent from the follow-on spoken command:

{
   is_understood : True,
   intent : changeLightState,
   slots {
     state : on,
   }
}
Enter fullscreen mode Exit fullscreen mode

The Show Context button opens a new window and lists all the available voice commands.

Create Custom Models

  1. Go back to the Upload Model page and copy the UUID to the clipboard using the Copy button.
  2. Go to Picovoice Console to create models for Porcupine wake word engine and Rhino Speech-to-Intent engine.
  3. Select Arm Cortex-M as the platform when training the model.
  4. Select the board type and provide the UUID of the chipset on the board.

Upload the Custom Models

  1. Download your custom voice model(s) from Picovoice Console.
  2. Decompress the zip file. The model file is either .ppn for Porcupine wake word or .rhn for Rhino Speech-to-Intent.
  3. Go to the Upload Model page and select the models.
  4. Press the Upload button.

Additionally, there are demo projects on the Picovoice GitHub repository for all supported boards to ease integrating the designed voice interface into projects.

If you need help, do not hesitate to create a GitHub issue

💖 💪 🙅 🚩
dilek
Dilek Karasoy

Posted on December 25, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Day 1: No-code Offline Voice Assistant
100daysofcode Day 1: No-code Offline Voice Assistant

December 25, 2022