Bulk Upload of AudioMoth Recordings

I’ve recently completed an extensive survey using AudioMoths and now have hundreds of one-minute recordings with confirmed presence of my target species, spread across a large geographic area. I’d like to upload these to iNaturalist.

Each .mp3 file includes the correct date, time, and GPS data. The problem is that iNaturalist doesn’t seem to read ID3 metadata from audio files—it only pulls EXIF data from images.

Has anyone found a good workflow for this? My current workaround is to create a blank image for each recording and embed the EXIF data there, so I don’t have to manually enter metadata hundreds of times.

This does work, but I still have to manually pair each recording with its corresponding image during upload, which is pretty time-consuming.

I considered bulk uploading via CSV and then attaching the recordings afterward, but that actually seems even slower.

Has anyone figured out a more efficient solution?

You can use R to extract the metadata, which could then populate a CSV. Here’s a code that extracts the metadata (filename, AudioMoth ID, temperature, time, battery level) of all the audio files in a folder. You can edit it for mp3s instead of wavs, and to also get lat/long.

2 Likes

https://www.openacousticdevices.info/audiomoth

I never heard of an AudioMoth, so I looked it up.

“Just like its namesake the moth, AudioMoth can listen at audible frequencies, well into ultrasonic frequencies”

So the device is NAMED after a moth, rather than being a device that IDs moths based on sound. I guess some moths produce ultrasonic clicks to deter bat predation, by jamming their sonar (echolocation), and some moths produce ultrasonic courtship songs, but not all moths do this.

2 Likes

Hi kevtolan. Thanks for the reply, but this does not really solve the issue. I already have all the mp3 recordings and metadata in a csv. The issue is when I use the uploader, it strips the metadata from the recording, so I need to manually add the date, time and coords.

you’d probably have to use the API(s) to handle this.

the oldest API provides a route for folks to upload sounds (and associate them with a specific observation ID) via POST https://www.inaturalist.org/observation_sounds. this appears to be what the observation page in the website uses to add additional sounds to observations.

the beta-ish v2 API also provides a route to upload sounds (and associate them with a specific observation UUID) via POST https://api.inaturalst.org/v2/sounds or (associating them with a specific observation ID) via POST https://api.inaturalst.org/v2/observation_sounds.

it looks like pyinaturalist provides a method to upload sounds based on the oldest API route. see https://pyinaturalist.readthedocs.io/en/stable/modules/pyinaturalist.v0.observations.html#pyinaturalist.v0.observations.upload_sounds. so you could use that to simplify the process of uploading a bunch of sounds and associating them to specific observations. (i don’t think it has anything based off of the v2 routes yet.)

it’s also possible to handle the entire upload process using the API. @jtklein wrote an example in a Juptyter Notebook that uses pyinaturalist to upload observations and photos. you could adapt that to upload observations and sounds instead.

1 Like

Yes, since posting this I’ve actually figured out how to do it with pyinaturalist. Only learnt of its existence today.

1 Like

if you’re willing, you should share a version of your code in case others in the future want to do something similar.

2 Likes