All Projects → aiXander → Realtime_pyaudio_fft

aiXander / Realtime_pyaudio_fft

Licence: mit
Realtime audio analysis in Python, using PyAudio and Numpy to extract and visualize FFT features from streaming audio.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Realtime pyaudio fft

ModularMusicVisualizer
Project in Hiatus, unmaintained, being rewritten privately. Will Open Source when stuff is ready. Project will be Renamed.
Stars: ✭ 81 (-84.27%)
Mutual labels:  audio-visualizer, fft
Awesome Web Audio
A list of resources and projects to help learn about audio
Stars: ✭ 73 (-85.83%)
Mutual labels:  audio-visualizer, fft
Fountain Of Colors
Music visualizer for Rainmeter
Stars: ✭ 65 (-87.38%)
Mutual labels:  audio-visualizer, fft
Spectro
🎶 Real-time audio spectrogram generator for the web
Stars: ✭ 383 (-25.63%)
Mutual labels:  audio-visualizer, fft
Modv
modular audio visualisation powered by JavaScript
Stars: ✭ 292 (-43.3%)
Mutual labels:  audio-visualizer
DTMF-Decoder
A Java program to implement a DMTF Decoder.
Stars: ✭ 28 (-94.56%)
Mutual labels:  fft
koch fractals
Koch Fractals Demo for Unity
Stars: ✭ 31 (-93.98%)
Mutual labels:  audio-visualizer
spectrogram
Taking an audio signal (wav) and converting it into a spectrogram. Written in Go programming language.
Stars: ✭ 34 (-93.4%)
Mutual labels:  fft
Dsp Theory
Theory of digital signal processing (DSP): signals, filtration (IIR, FIR, CIC, MAF), transforms (FFT, DFT, Hilbert, Z-transform) etc.
Stars: ✭ 437 (-15.15%)
Mutual labels:  fft
Sleef
SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT
Stars: ✭ 353 (-31.46%)
Mutual labels:  fft
catnip
terminal audio visualizer for linux/unix/macOS/windblows*
Stars: ✭ 79 (-84.66%)
Mutual labels:  audio-visualizer
filtering-stft-and-laplace-transform
Simple demo of filtering signal with an LPF and plotting its Short-Time Fourier Transform (STFT) and Laplace transform, in Python.
Stars: ✭ 50 (-90.29%)
Mutual labels:  fft
React Mic
Record audio from a user's microphone and display a cool visualization.
Stars: ✭ 323 (-37.28%)
Mutual labels:  audio-visualizer
audio-waveform-svg-path
Building path for SVG element to perform waveform view of audio file
Stars: ✭ 39 (-92.43%)
Mutual labels:  audio-visualizer
Competitive Programming Repository
Competitive Programming templates that I used during the past few years.
Stars: ✭ 367 (-28.74%)
Mutual labels:  fft
aurora-sdk-win
An SDK to develop effects for Nanoleaf Light Panels using features like frequency, beat, or tempo.
Stars: ✭ 22 (-95.73%)
Mutual labels:  fft
WaveFormViewDemo
Provides a view to display audio waveforms.
Stars: ✭ 39 (-92.43%)
Mutual labels:  audio-visualizer
Pitch Detection
collection of O(NlogN) pitch detection implementations
Stars: ✭ 335 (-34.95%)
Mutual labels:  fft
webgl-3d-animation
An interactive 3D animation using WebGL to depict a 2D predator prey ecology on a grid real-time mapped onto the surface of a 3D torus. Sound file is parsed then visualized both in time and frequency domains as well as rendered using Web Audio API - this is an exercise where I taught myself how to display data for an ongoing project on sound syn…
Stars: ✭ 23 (-95.53%)
Mutual labels:  audio-visualizer
Audio Spectrum Analyzer In Python
A series of Jupyter notebooks and python files which stream audio from a microphone using pyaudio, then processes it.
Stars: ✭ 273 (-46.99%)
Mutual labels:  fft

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.

Demo Video

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 libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 (tested on Ubuntu)

I developped this code on my local machine --> it has not been properly tested on other setups.. If something doesn't work, please first try to fix it yourself and post an issue/solution when appropriate!

  • Tested on Ubuntu 18.04
  • Other platforms like Mac/Windows should work if PyGame can find your display and Python finds your audio card (these can be tricky with WSL)
  • For Mac OSX (tested on Catalina 10.15.4), please make sure you run with Python downloaded from Python.org (pygame doesn't work well with the default/Homebrew Python)

Tested with:

  • Python 3.6.3
  • pygame --> Version: 1.9.6
  • pyaudio --> Version: 0.2.11
  • scipy --> Version: 1.4.1

Alternatively to pyaudio, you can use sounddevice which might be more compatible with Windows/Mac

  • just run python3 -m pip install sounddevice
  • Tested on Ubuntu 18.04 with sounddevice version 0.3.15
  • The code to switch between the two sound interfaces is in the __init__ function of the Stream_Analyzer class

Usage:

  • I have personally learned A LOT about sound by watching this realtime visualization while listening to music
  • You can run the stream_analyzer in headless mode and use the FFT features in any Python Application that requires live musical features

Teaser image

ToDo:

  • Implement realtime beat detection / melody extraction on top of FFT features (eg using Harmonic/Percussive decomposition)
  • The pygame.transform operations sometimes cause weird visual artifacts (boxes) for some resolution settings --> fix??
  • Remove the matplotlib dependency since it's only needed for the colormap of the vis..
  • Slow bars decay speed currently depends on how often .get_audio_features() is called --> fix
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].