arecord -Dhw:0,0 -f S16_LE -r 16000 -c 2 hello.wav
aplay -Dhw:0,1 -r 16000 -c 2 hello.wav
# record 8 channels audio
# there are 6 microphones on board, and ac108 compose the 2 remaining channels.
arecord -Dhw:0,0 -f S16_LE -r 16000 -c 8 hello_8ch.wav
2. Te st v ia Pulse Audio
First check w hether the PulseAudio is running:
respeaker@v2:~$ ps aux|grep pulse|grep -v grep
1109 0.0 0.7 363272 7932 ? S<l 01:01 0:00 /usr/bin/pulseaudio --start --log-target=syslog
If it's not, please ref er to PulseAudio's documentation to enable the auto-spaw n of PulseAudio. Then test via:
parecord --channels=8 --rate=16000 --format=s16le hello2.wav
paplay hello2.wav
Further more, the def ault ALSA device now hooks to PulseAudio, so using the f ollow ing commands also plays/records sound via PulseAudio:
arecord -v -f cd hello3.wav
aplay hello3.wav
So f ar w e learned the basic operations of the ReSpeaker Core v2 board, let's move f orw ard. We can use ReSpeaker Core v2 to build our ow n AVS(Alexa Voice
Service) device or Dueros(Voice assistance of Baidu) device.
Play with AVS (Alexa Voice Service)
This guide w ill show s you how to build an AVS device based on the ReSpeaker Core V2.
Ste p 1. Install AVS library (Python)
respeaker@v2:~$ sudo apt update
respeaker@v2:~$ pip install avs
This w ill also install the f ollow ing executables into
~/.local/bin
: alexa-audio-check, alexa-auth, dueros-auth, alexa-tap and alexa.
Tap the command below to Check the audio conf iguration:
respeaker@v2:~$ ~/.local/bin/alexa-audio-check
This script calculates the RMS of the sound recorded by the microphones.
Ste p 2. Authorize Ale xa
Connect to the board via
. In the VNC desktop, open terminal and execute:
respeaker@v2:~$ ~/.local/bin/alexa-auth
This script w ill open the w eb brow ser automatically, the w eb brow ser w ill display a login page. Sign in w ith your Amazon account: