开发者

Rapid spectral analysis of audio file using Python 2.6?

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 compl开发者_运维问答ete loss as to what libraries I should even be using.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜