How to extract frequency information from an input audio stream (using PortAudio)?

后端 未结 2 608
慢半拍i
慢半拍i 2021-02-04 22:42

I want to record sound (voice) using PortAudio (PyAudio) and output the corresponding sound wave on the screen. Hopeless as I am, I am unable to extract the frequency informatio

2条回答
  •  情深已故
    2021-02-04 23:15

    What you want is probably the Fourier transform of the audio data. There is several packages that can calculate that for you. scipy and numpy is two of them. It is often named "Fast Fourier Transform" (FFT), but that is just the name of the algorithm.

    Here is an example of it's usage: https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/advanced/spectrum.py

提交回复
热议问题