Granular volume data from MP3 files?
March 10, 2009 10:13 AM   Subscribe

I'm looking for a command-line tool that can return a volume value for specific points of time in an MP3 file.

Basically, I need an array of volume values for an MP3 file. Preferably, one value for every 1/30th of a second of audio. The data will be used for visualization, so the values don't have to be extremely accurate or in any particular unit of measurement.

In a perfect world, this would be an open source python-based tool.

Any ideas?
posted by joe vrrr to Computers & Internet (7 answers total) 1 user marked this as a favorite
 
Best answer: You might take a look at SoX. It does list analysis of audio as one of its capabilities. Wether or not it can do exactly as you desire is another question. It most certainly can be extended to provide what you want.
posted by mmascolino at 10:18 AM on March 10, 2009


Try remix. I'm not sure that it has this functionality, but it does lots of other similar things.

It's been in the news lately because of this post on detecting drummers who are a little too perfect, and thus are probably using click-tracks.
posted by chrisamiller at 10:34 AM on March 10, 2009


This is easy and there are a lot of easy tools to use to do it. Many ways to do it. One of them I noticed lately is Echonest. Since you're interested in doing this visualization with Python, may I also recommend NodeBox? It supports direct output to Quicktime, and has a nice asynchronous web API, so it should be trivial to programmatically UL your track to Echonest, harvest the results, and visualize them.
posted by doteatop at 10:38 AM on March 10, 2009


Response by poster: Ah ... I should have added that my planned usage can not connect to any HTTP services, so Echonest and remix can't be used. I'm looking into SoX now.

Anything else I should investigate?

Thanks everybody.
posted by joe vrrr at 11:59 AM on March 10, 2009


Response by poster: It looks like SoX only returns the average, min and max volume for the entire file. No ability to return a value for a specific period of time as far as I can tell.

Still looking ...
posted by joe vrrr at 4:48 PM on March 10, 2009


Best answer: Try SoX's trim plugin, it can define slices to process and/or analyse.

sox input.wav output.wav trim 30s 10s stat

This would start reading at 30 samples and get the statistics for the next 10 samples.
posted by phax at 5:39 AM on March 11, 2009


Response by poster: Great. I'm now off to write a shell script for SoX. Thanks!
posted by joe vrrr at 8:14 AM on March 12, 2009


« Older Where to go in the Irish countryside?   |   Calling all Bucureşteni and Istanbullus Newer »
This thread is closed to new comments.