Create your open source voice assistant

Presentation

If you are like me concerned about your privacy and you promote open source solutions, good news. Today I suggest you replace your Google health home and Alexa with an open source voice assistant that you can build yourself.

For this, we will use our good old Raspberry Pi and the development board Matrix Voice. The Matrix Voice Wi-Fi is designed to provide every handyman and developer with a complete and user-friendly tool for creating voice applications. It is equipped with 18 RGBW LEDs and 8 MEMS microphones. Its wireless Wi-Fi b / g / n and Bluetooth 4.0 connectivity and its on-board RAM allow it to be as autonomous as it is associated with a Raspberry Pi or Raspberry Pi Zero.

In short, you will have understood, Matrix Voice to all of a great, capable of facing the competition without blushing. It is so much to get into the heart of the matter.

Installation of our open source voice assistant

Before you get started, here's what you'll need.

  • Raspberry Pi 3 B / B + / Zero (recommended) or Pi 2 Model B (supported).

  • MATRIX Voice

  • Micro-USB power adapter for Raspberry Pi.

  • Micro SD card (minimum 8 GB)

  • Speakers

  • Internet connection (Ethernet or WiFi)

We start by installing Raspbian Stretch on our SD card using Etcher. Compatibility with Raspbian Buster is not yet available. Then install the Matrix Voice and the SD card on our Raspberry Pi, just place it on the 40 pins connector.

Matrix Voice Case 05 - Create your open source voice assistant

We also take the opportunity to create an account on the site snips.ai, SNIPS will be the software that will act as intelligence for our voice assistant.

Installation of bookstores

Now that our Raspberry Pi has its Raspbian OS, we are going to install the libraries necessary to use our Matrix Voice.

Run the following commands in the terminal of your Raspberry Pi to add the MATRIX repository and update your packages.

curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add –

echo “deb https://apt.matrix.one/raspbian $ (lsb_release -sc) main” | sudo tee /etc/apt/sources.list.d/matrixlabs.list

sudo apt-get update

sudo apt-get upgrade

Matrix Voice terminal 11 - Create your open source voice assistant

We restart our Raspberry Pi

sudo reboot

Install the MATRIX kernel modules. This allows the microphones of your MATRIX device to register as an ALSA microphone on your Raspberry Pi.

sudo apt install matrixio-kernel-modules

Matrix Voice terminal 09 - Create your open source voice assistant

We restart our Raspberry Pi again

sudo reboot

Our Matrix Voice is now usable from your Raspberry Pi. To check, launch the command alsamixer and the card MATRIXIO-SOUND should appear.

Matrix Voice terminal 03 - Create your open source voice assistant

Installation of the SNIPS open source voice assistant

Now let's go to our voice assistant. For this, we will use the utility SAT which will allow us to configure and monitoring our voice assistant SNIPS remotely.

On your personal computer, you must first install Node.js. Once installed, you can install SAT on your computer using the following command.

sudo npm install -g snips-sam

Still from our personal computer, we issue the following commands:

sam connect 192,168, x, x

Matrix Voice terminal 06 - Create your open source voice assistant

We replace the IP address with the IP address of our Raspberry. We enter the Raspberry Pi login and password to connect to it.

To start the installation of SNIPS we launch the command:

sam init

After a few minutes, your SNIPS is installed, now let's go to the configuration. It took less than 10 minutes.

The configuration of our open source voice assistant

The next step is to edit the file snips.toml to configure the microphones and the speaker.On the terminal of your Raspberry Pi, run the following command:

sudo nano /etc/snips.toml

Scroll to where you see (Audio-server-snips) and replace

# mike = “Built-in Microphone”

through

mike = “MATRIXIO-SOUND: – (hw: 2.0)”

Press ctrl + x, press y, and then press the Enter key to save your changes.From our personal computer, we will configure the microphone, the speakers and verify that everything works. For this we issue the command:

sam audio setup

Matrix Voice terminal 08 - Create your open source voice assistant

We will be able to choose among all the available equipment, the one we want to use.Once this is done, the equipment can be tested independently with the commands:

sam Review speaker

sam microphone Review

If both commands seem to work, you have correctly configured SNIPS on your Raspberry Pi! In case of concerns, you can in the Raspi-config force audio output in "Auto".

And if for example, like me, you want to use the speakers present on the Matrix Voice and not the speakers, just go to alsamixer then MATRIXIO-SOUND and modify the output headphone in speakers.

Matrix Voice terminal 03 - Create your open source voice assistant

In order to verify that all the services are started, we use the following command:

sam status

Matrix Voice terminal 04 - Create your open source voice assistant

You’ve finished setting up your voice assistant so that it can hear and answer you, so let's give it a go.

Getting started

Let's get down to business, now that everything is installed, we're going to configure our SNIPS to just tell us the time.We go to our account snips.ai, we create a new assistant for which we enter the name, the language and the hotword (trigger word).

Now we can add functionality by adding applications. We search and select the application " Hour ".Once done, at the bottom right of the main page, we have a button " Deploy assistant ". When we click on it, we get an order to launch from our personal computer.

This command will install our assistant as well as the selected applications.

Once done, we have more than trying all that. To have the debugging console, run the following command:

sam watch

Then pronounce the hotword here Jarvis and ask " what time is it ? He should answer you by giving the time.If everything goes well you will see the question and the answer in the debug console.

Matrix Voice terminal 07 - Create an open source voice assistant

More in the next article

After this first example, we will see together in our next article how to operate our open source voice assistant SNIPS with our Jeedom.

Attractive prospect of being able to pilot our house by voice, don't worry it will be simple to set up and I have a little surprise for you.

AB SMART HEALTH health home & BUILDING REVIEW