I was working on a project using my Udoo quad board and I needed to implement speech processing in it. The first thing which came to my mind was the google's speech API. But it was an online process and also there is a limit up to which I can use it. So I started looking for an offline speech processing API. I traveled the galaxy in the search of the so-called "offline speech processing" and then one day I stumbled upon a website called kitt.ai. Where I finally found my "offline speech processing". But wait, they call it snowboy, a "hotword detector" and they don't make it for Udoo boards but they do make it for the raspberry pi. I researched further on their website and found out that I can also use sentences. So I decided to install it on my Udoo board as raspberry pi and Udoo board is somewhat similar.
Here are the steps that you need to follow in order to make snowboy work in Udoo.
Step 1From this page download the Raspberry Pi version: http://docs.kitt.ai/snowboy/#downloads
Step 2: Install Sox$ sudo apt-get install python-pyaudio python3-pyaudio sox
Step 3: Install PortAudio’s Python bindings$ pip install pyaudio
Step 4To check whether you can record via your microphone, open a terminal and run:
$ rec temp.wav
Step 5: Running a demo- Extract the file that you have downloaded in the first step.
Go to the "rpi-arm-raspbian-8.0-1.2.0/resources" folder and copy the snowboy.umdl and paste it outside the "resources" folder.
- Run this in the terminal:
$ python demo.py snowboy.pmdl
- When you say snowboy it should give output like this:
$ INFO:snowboy:Keyword 1 detected at time: 2017-01-01 01:01:14
- But it's more likely that you will get an error because this package is not made for Udoo boards.
ImportError: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/udooer/rpi-arm-raspbian-8.0-1.2.0/_snowboydetect.so)
So let's solve this error.
Step 6: Solving the error- Try this:
$ sudo apt-get update
$ sudo apt-get install gcc-4.7 g++-4.7
- If it doesn't work, create the source file manually:
$ sudo nano /etc/apt/sources.list.d/toolchain.list
- Paste this content:
$ deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main
$ deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main
- Save the file with Ctrl-X and then press Y key to confirm saving.
- After adding those lines, issue this command to fix the key error.
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F
- Then run these commands in the terminal:
$ sudo apt-get update
$ sudo apt-get install gcc-4.7 g++-4.7
- It should fix the error. Now run the demo again.
- Log in the snowboy website and create your own hotword.
- Improve the hotwords prepared by me like YES and NO.
- Download the YES and NO hotwords because we are going to use it in the codes given below.
Comments