Studio microphones are typically defined as mics that adhere to ‘AES42’. Published by the Audio Engineering Society, AES42 is a standard for connecting microphones to digital recording equipment. In a nutshell, an XLR cable (the three pin variant is the most common) sends audio to your computer (analog-to-digital converter) and power to the microphone. Oh. Power. Chances are you going to run into the phrase ‘phantom power’. Your microphone needs power, and your audio interface is what usually supplies it. So phantom power is just the electricity that your microphone needs. Make sure the voltage requirements of your microphone matches the audio interface (There are three variants of phantom power, 12, 24 and 48 volts).
To connect a studio microphone to your Raspberry Pi, you will need the following:
- Studio Microphones, I used the Behringer C-2.
- A USB Audio interface with phantom power, I used the Scarlett Solo from Focusrite.
- An XLR cable.
- A powered USB hub.
Wiring this up is straight forward. The only catch to keep in mind is that you need an external powered USB hub to provide enough power to the audio interface and microphone.
The following configuration tweaks make the Scarlett audio interface detected in Raspbian.
- Change the line
options snd-usb-audio index=-2in
options snd-usb-audio index=0this will make the USB audio interface the default sound source.
- Add the line
/boot/cmdline.txt. This will allow the scarlett audio interface to be correctly detected.
You are now all ready to record audio to your Raspberry Pi. From the command line:
$ arecord --duration=10 -D plughw:1 -c 2 -f S32_LE foo.wav
Or, the PortAudio library can access audio data from your own software.
$ sudo apt-get install libasound2-dev $ wget http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz $ tar -xvzf pa_stable_v19_20140130.tgz $ cd portaudio $ ./configure $ make $ sudo make install
Hi! Subconsciously you already know this, but let's make it obvious. Hopefully this article was helpful. You might also find yourself following a link to Amazon, Lego or eBay to learn more about parts or equipment. If you end up placing an order, I make a couple of dollarydoos. We aren't talking a rapper lifestyle of supercars and yachts, but it does help pay for the stuff you see here. So a massive shoutout to everyone that enables this place. Thanks!