Today’s project is a ReSpeaker 4-Mic Array for the Raspberry Pi. It is a quad-microphone expansion board designed for AI and voice applications. This means that we can build a more powerful and flexible voice product that integrates Amazon Alexa Voice Service, Google Assistant, and so on.
The Respeaker comes assembled and easily fits onto any Raspberry Pi provided that the header is already installed to it.
Mount ReSpeaker 4-Mic Array on Raspberry Pi, make sure that the pins are properly aligned when stacking the ReSpeaker 4-Mic Array for Raspberry Pi.
Note: Hot-plugging ReSpeaker is not allowed. It will damage the respeaker.
Install driver
The AC108 codec is not supported by Pi kernel builds currently, we have to build it manually.
- Step 1. Please Make sure running the latest Raspbian Operating System(Debian 9) on Pi.
- Step 2. Get the seeed voice card source code.
sudo apt-get update
sudo apt-get upgrade
git clone https://github.com/respeaker/seeed-voicecard.git
cd seeed-voicecard
sudo ./install.sh
reboot
- Step 3. Then select the headphone jack on Raspberry Pi for audio output:
sudo raspi-config
# Select 7 Advanced Options
# Select A4 Audio
# Select 1 Force 3.5mm (‘headphone’) jack
# Select Finish
BONUS: Play with APA102 LEDs
Each on-board APA102 LED has an additional driver chip. The driver chip takes care of receiving the desired color via its input lines and then holding this color until a new command is received.
- Step 1. Activate SPI:
- sudo raspi-config
- Go to “Interfacing Options”
- Go to “SPI”
- Enable SPI
- Exit the tool
- Step 2. Get APA102 LEDs Library and examples
pi@raspberrypi:~ $ cd /home/pi
pi@raspberrypi:~ $ git clone https://github.com/respeaker/4mics_hat.git
pi@raspberrypi:~ $ cd /home/pi/4mics_hat
pi@raspberrypi:~/4mics_hat $ sudo apt install python-virtualenv
pi@raspberrypi:~/4mics_hat $ virtualenv –system-site-packages ~/env
pi@raspberrypi:~/4mics_hat $ source ~/env/bin/activate
(env) pi@raspberrypi:~/4mics_hat $ pip install spidev gpiozero
- Step 3. Then run the example code under virtualenv, now we can see the LEDs blink like Google Assistant.
(env) pi@raspberrypi:~/4mics_hat $ python pixels_demo.py
There is a LOT more you can do with this board but I will leave that for you to discover. There is a great WiKi on this over at the Seeed Studio website.
The main reason for me wanting to install the Respeaker is that there are two programs that I used on a regular basis that require a microphone to work and this is the perfect solution for my needs. Those programs are:
Both are easy to install and I will show you how to install both of these in a future video.
Final Thoughts:
The Respeaker is a great add-on for the Raspberry Pi. It is expensive but it has a lot to offer. For all of my future projects, this seems for now to be a good choice. See you next week!