BigTom

BigTom

Support for high quality microphone

Hi,

This is very early days in my Nerves journey. Does anyone know what route to take for getting good quality audio recording on Nerves (probably a Raspberry Pi)? Toying with the idea of building a long running bird song recorder for ecological research and wondered if this was at the “sure just use this library” end of the spectrum or at the “read these 8 specs then implement them as a C NIF” end?

Also, I have assumed “high end” is more than a jack/USB mike is capable of but maybe I am overthinking it?

Thanks

Most Liked

gus

gus

Nerves Core Team

I would say that the problem greatly depends on the hardware you are using. There are many types of microphones and interfaces but you will likely want to use a HAT with an I2S interface or use a USB sound card.

For the quality of the recordings, I think the biggest factor will be the actual microphone, as the characteristics (such as directionality, frequency range, etc) can vary drastically. I suggest you go with whatever is easiest to acquire and get started with (especially some sort of kit from Adafruit or Sparkfun, as they have good docs)

From the software side, fortunately it all looks pretty similar. Audio is typically handled in the kernel, so you’ll have to customize the nerves system for the board you’re using to add the driver. You might also want to add the alsa package for interacting with the drivers such as recording audio files.

There’s lots of resources and help in the community if you get stuck on this part

al2o3cr

al2o3cr

What’s your power budget look like for this application? A lot of fancy audio capture stuff is going to assume you’re either plugged in (studio etc) or only want to use it for a couple hours (live performance and similar)

The simplest (but also probably biggest + most power-hungry) approach would be to use a USB audio capture device or a microphone with one integrated (usually called a “USB mic”).

Other options:

  • use any analog microphone with an I2S ADC, for instance the Teensy Audio Adapter. You’d need a driver for it to work with Nerves, though.
  • use I2S microphones directly, for instance using modules like this breakout board. Two of these can be used on a single I2S port for stereo operation

The other neat thing that can be done with the tiny I2S microphones is using a bunch of them and then applying post-processing (similar to techniques used in radar) to form directional “beams” that can be adjusted after recording. This would naturally involve a LOT more data (dozens of audio streams) but could produce results that are impossible with a mono or stereo signal.

al2o3cr

al2o3cr

I believe so:

  • On the RPi4, there’s a 2-channel PCM peripheral available on GPIO18-21.
  • On the RPi5, there are 3 separate I2S peripherals provided by the RP1. (2-4 channels each)

Last Post!

BigTom

BigTom

Thanks for this, with current progress and solar and batteries I am pretty confident I can meet the power needs within my budget (unless I am orders of magnitude wrong).

I am starting from a VERY LOW level of knowledge here so I will be starting as simple as possible. OTOH - sounds very cool!

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement