Listening to Bird Sounds
July 24, 2023
I am not an ornithologist, an audio expert, or a linux master. Assume everything in this post is only partially true.
Late last year, I discovered the open source BirdNET-Pi project, a bird sound recording software package made specifically for the Raspberry Pi using machine learning models from Cornell University’s BirdNET project. You give it an audio input from one or two microphones and it automatically identifies any of over 6,000 different species of bird by its song/chrip/etc. While its doing that, it also chops up the audio, making clips of every ID, and catalogs them all so that you can get a good idea of the types of birds in your area and how active they are. I’m no ornithologist but learning which calls are made by which birds from recordings made directly in my backyard is pretty neat.
This requires a few pieces of hardware:
- Audio Interface
For my compute, I’m using a Raspberry Pi 4. My initial setup used a 3B, but I ended up switching to the 4 after some issues which I’ll explain below. The software install is incredibly simple. Just run a single command from a raspbian install and you are good to go.
Out of the box, the Raspberry Pi doesn’t have any audio inputs, which means you are going to need a USB audio interface of some kind. I happened to have a few old PreSonus AudioBox USBs laying around, so I grabbed one for this setup. They are complete overkill while also being totally impractical for any kind of use in a small outdoor enclosure (which I would like to eventually make) but they are what I had.
Microphones are the underrated, secret sauce of the operation. I started doing a bunch of research and decided I wanted to record in stereo. Because of that and my interest in learning more about this massive world of microphones and field recording, I ended up following one of the many amazing guides from Sound Sleuth: the Sound Sleuther, a PUI5024 based microphone (Instructable). For about the cost of a cup of coffee, these microphone capsules sound phenomenal, have a really low noise, and are super sensitive. As long as you are comfortable with a little soldering, the construction is a breeze. I ended up wiring each of my mics separately with XLR but for a more permanent space conscious design, I definitely would go with a single stereo 1/8" jack.
Currently, my setup is living on my window sill with the 2 PUI5024 microphones just outside the window and window closed on the wires. In attempt to protect them from the elements (mainly rain and wind), I also have fluffy ‘dead cats’ on each of them.
For most of my time using BirdNET-PI, I was running it on a RPi 3B and had some very consistent audio issues. The audio quality was very low and it was almost as though it was peaking, even on quiet sounds. I endlessly troubleshot this. First with an off-the-shelf Sennheiser MKE 600, to prove my DIY mics were ok. They were, same issue with the MKE 600. Then I swapped my known working Focusrite Scarlet 2i2 audio interface, same issue still. I tried swapping power supplies thinking issues were being induced there, nope. Eventually, I took an RPi 4 that I hadn’t started using yet and installed BirdNET-PI on it. Moved the rest of the audio chain (interface, mics) over to it and tested there. The audio was pristine. Not exactly the kind of answer I like finding but everything is working beautifully now, so I shouldn’t complain.
With that swap to the RPi 4, I also got to test out the backup/restore functionality in the BirdNET-PI interface. Behind the scenes, it uses an SQLite database, which makes moving as simple as a file copy and, in addition, all of your recorded clips are neatly stored a few directories away. Moving the clips isn’t really necessary, as I’m not sure I’ll ever be going back in the archives to listen to that one time that Robin sang, but I feel bad abandoning data like that.
While the stated purpose of the software is great and has been incredibly educational for me, I’m finding another really enjoyable use case: listening to the live audio stream. I’ve long been a fan of ASMR and the idea of ambient binaural sounds and piping in the soft sounds of nature into my home office while I work has definitely scratched that itch. This proves to be even more valuable when I’m at the office where my office doesn’t even have any windows. Pull up my BirdNET-PI over it’s Tailscale connection and I instantly have a little coziness in my otherwise drab office.
- Move everything to an enclosure and mount outside
- Add air monitoring (temp/humidity/pressure/air quality)