How to do a Fourier transform on input from a microphone and obtain the average amplitude of a certain frequency range I'm building a sound visualizer with LED strips controlled by python, and I'm trying to learn how to use pyAudio to perform rapid Fourier transforms on live mic input and obtain the average amplitude of a certain range of frequencies.

How do I open a sound stream and consistently update the current amplitude (say, a variable called "amplitude") of a given frequency range with the live FFT data? I have set up all the hardware and all the basic pyAudio functions work so far.
If you know the frequencies you're interested in, you might be better off just calculating the power / energy at those frequencies rather than using a full FFT.

The best algorithm to do that is probably the Goertzel algorithm.  There is a python implementation of that here, and a related SP.SE question here.