views:

75

answers:

1

What I want to do is to have a subroutine that analyses every 200 milliseconds of a sound file which it is given and spits out the frequency intensity value (from 0 to 1 as a float) of a specific frequency range into an array which I later save. This value then goes on to be used as the opacity value for a graphic which is supposed to 'strobe' to the audio file.

The problem is, I have never ventured into audio analysis before and have no clue where to start. I have looked pymedia and scipy/numpy thinking I would be able to use FFT in order to achieve this, but I am not really sure how I would manipulate this data to end up with the desired result. The documentation on the SpectrAnalyzer class of pymedia is virtually non-existant and the examples on the website do not actually work with the latest release of the library - which isn't exactly making my life easier.

How would I go about starting this project? I am at a complete loss as to what libraries I should even be using.

A: 

You will first need to understand how sampling works, then you should use Scipy FFT routines (they are pretty fast) in order spit out frequency intensity values, then you can use Matplotlib to plot such graphics. See here for an article about using Python to analyze sound files and here is a similar question about FFT and Spectograms in Python.

Tarantula
I've got the data that I think I need now after using scipy.io.wavfile to load the signal of my audio file and the specgram function from matplotlib to analyze it, but I have no clue as to what to do with this data.It seems to be everything that I need - I just have no idea to make it tangible.Any ideas?
Ephemeralis