조회 수 8733 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print

https://maker.pro/raspberry-pi/tutorial/the-best-voice-recognition-software-for-raspberry-pi




On a mission to find the best voice-recognition software for Raspberry Pi, I installed and tested three different systems. Two were internet-dependent and one was offline.

  1. Jasper
  2. Raspberry Pi Voice Recognition by Oscar Liang
  3. Raspberry Pi Voice Control by Steven Hickson

Out of these three, the Voice Control software created by Steven Hickson seems to be the most precise and potent.

The Jasper system, even though it works offline, compromises accuracy and speed. This would be useful for systems that have no access to the internet, though. A small caveat: The system takes up almost a whole 4GB memory card, so use at least an 8GB card with it. Some of its services are cumbersome and take a lot of effort from the user to pronounce repeatedly until the system picks it up.

The softwares presented by Oscar and Steven use Google voice APIs, they are very accurate and precise. Both of them also use Google speech, so the system can be manipulated to talk back and respond to your commands and queries. But I prefer the third software because it has a simple and straightforward interface. Here, you will be able to define each of your voice commands and link them to particular tasks in the form of bash commands. These are defined inside a configuration file.

Following is a detailed tutorial explaining the installation and use of this voice recognition software for Raspberry Pi. The video at the bottom gives you a feel for the voice control software before you install it.

You cannot use normal microphones with audio jacks because the raspberry pi does not have a sound card. Hence, only use USB webcams with inbuilt mic or USB microphones. I am using a cheap USB webcam with an inbuilt mic.

ezgif.com-webp-to-jpg (1).jpg

How Does the Voice Recognition Software Work? 

The software being described here uses Google Voice and speech APIs. The voice command from the user is captured by the microphone. This is then converted to text by using Google voice API. The text is then compared with the other previously defined commands inside the commands configuration file. If it matches with any of them, the bash command associated with it will be executed. You can also use this system as an interactive voice response system by making the Raspberry Pi respond to your commands via speech. This is achieved by using the Google speech API, which converts the text into speech. Here's a block diagram showing you the basic working of the voice recognition software for Raspberry Pi:

ezgif.com-webp-to-jpg (2).jpg

Step 1: Checking Your Microphone 

You need to first check whether your microphone records properly. First, check if your webcam or microphone is listed using the command "lsusb". Check if your mic/webcam comes up on the list.

Next, we need to set the mic recording volume to high. To do this, enter the command "alsamixer" in the terminal. On the graphical interface that shows up, press the up/down arrow keys to set the volume. Press F6 (all), then select the webcam or mic from the list. Again, use the up arrow key to set the recording volume to high.

ezgif.com-webp-to-jpg (3).jpg

Now, you need to check if the recording takes place properly. Use the command “arecord -l” to check if your mic/webcam is listed. Then, use the command “arecord -D plughw:1,0 test.wav” to record sound. The sound will be recorded in the file “test.wav”. To listen to it, plug in your headphones to the pi and enter the command “aplay test.wav” in the terminal. If you’re able to hear the sound, your microphones works perfectly, else try adjusting the volumes and repeat the previous steps.

STEP 2: Installing the Voice Recognition Software for Raspberry Pi

This software was created by Steven Hickson and utilizes Google voice API. To install this software, execute the following commands one after the other:

  • wget –no-check-certificate “http://goo.gl/KrwrBa” -O PiAUISuite.tar.gz
  • tar -xvzf PiAUISuite.tar.gz
  • cd PiAUISuite/Install/
  • sudo ./InstallAUISuite.sh

Please, not that the wget command in the first line uses two dashes (- -) before “no-check”. During the installation, several questions shall pop up. You need to read these carefully and press y/n accordingly. I would recommend you to press y for all of them.Some of the questions include: Do you want to set a keyword? (Keyword is a voice command like a name, the system gets activated only when first use this command), Do you want to set filler flag to zero? (Press y, else you will always hear “Filler Fill” before every speech response from the pi) , Do you want to install youtube-dl? (A terminal service for playing youtube videos), etc. Options for changing the listening duration and system response is also presented during the installation. Read carefully each of these questions and respond accordingly.

ezgif.com-webp-to-jpg (4).jpg

STEP 3: Using the Voice Control Software and Setting Up Your Own Commands 

You can verify the voice-to-text conversion by running "./speech-recog.sh" in the directory: /home/pi/PiAUISuite/VoiceCommand. The software is activated to run continuously when you execute the command "sudo voicecommand -c" in the terminal. By default, the keyword used to activate it is "Pi" — only after saying "Pi" while it is listening can you execute the other commands. Check out the video below to get a feel for the software.

I would recommend changing the keyword from "Pi" to something else, as the system usually interpreted it for me as "Hi". You can change the keyword and other voice commands and actions by opening the commands configuration file. To do this, enter the command "voicecommand -e". Inside this, you can see various options for setting the keyword, the speech response, etc. Please remove the "#" before the lines in the file when changing them.

ezgif.com-webp-to-jpg (5).jpg

Here, each command is linked to a particular action, e.g., "Youtube==youtube-search ..." When you say, for example, "Youtube android", it runs the command "youtube-search android" in the bash. The "..." stands for anything you say after the command "Youtube". In the case of the voice command definition: "play $1 season $2 episode $3 =playvideo -s $2 -e $3 $1". So when you say, for example, "play Big Bang Theory season 1 episode 4", it executes the command "playvideo -s 1 -e 4 Big Bang Theory", i.e., it plays the fourth episode of the first season of The Big Bang Theory.

So, if you want to add a new voice command to this — like "check internet" that uses "ping" to check your internet connection — in the configuration file, enter a line like this: "check internet==ping google.com". It executes "ping google.com" when you say "check internet".

ezgif.com-webp-to-jpg (6).jpg

Use this system for home automation, robotics, and other cool stuff. This software is fast and accurate for your applications. Now, the video of the voice control software in action:


Dreamy의 코드 스크랩

내가 모으고 내가 보는

List of Articles
번호 분류 제목 날짜 조회 수 추천 수
450 Android git archive 를 사용해서 폴더를 .git 제외하고 tar 나 zip 으로 묶기 1 2019.02.10 10096 0
449 LINUX vi 설정하기(.vimrc) 2019.02.01 7955 0
448 Pi 칩 저항 사이즈표, 사이즈변환, 와트, 오차표 2019.01.11 13229 0
447 Pi NPN과 PNP 트랜지스터의 차이 2019.01.03 16591 0
446 Pi 포토커플러 Photo Coupler 특징, 종류, 출력, 구조, 동작 원리, 파라미터 2019.01.03 29415 0
445 LINUX vim 에디터 이쁘게 사용하기 2018.08.06 18551 0
444 Pi 아두이노에 도움이 되는 전자부품들 2018.06.20 7992 0
443 일반 Visual Studio Code 환경 설정 및 사용 방법 1 2018.06.01 26279 0
» Pi 라즈베리파이 음성인식 S/W 2018.04.26 8733 0
441 Pi 파이썬 코드를 이용한 파이카메라 제어 2018.04.24 12911 0
440 Pi 라즈베리파이 PI CAMERA 설치하기 2018.04.24 11771 0
439 Python [tensorflow] 텐서플로우 문서 한글번역본 2018.03.22 7399 0
438 Pi LiPo charger 리튬 배터리 충전모듈 사용법 file 2018.03.19 10889 0
437 Pi Arduino Pro Mini PIN 정보 file 2018.03.18 9497 0
436 일반 날씨정보 rss 2018.03.08 7149 0
목록
Board Pagination ‹ Prev 1 2 3 4 5 6 7 8 9 10 ... 34 Next ›
/ 34

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소

Designed by sketchbooks.co.kr / sketchbook5 board skin

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5