Realtime_PyAudio_FFT
A simple package to do realtime audio analysis in native Python, using PyAudio and Numpy to extract and visualize FFT features from a live audio stream.
The basic pipeline:
Starts a stream_reader that pulls live audio data from any source using PyAudio (soundcard, microphone, ...)
Reads data from this stream many times per second (eg 1000 updates per second) and stores that data in a fifo buffer
When triggered by .get_audio_features(), the stream_analyzer, applies a Fast-Fourier-Transform to the most recent audio window in the buffer
When visualize is enabled, the visualizer displays these FFT features in realtime using a PyGame GUI (I made two display modes: 2D and 3D)
Requirements:
pip install -r requirements.txt
If you're having trouble installing PyAudio, you might want to sudo apt install libasoun