aiXander/Realtime_PyAudio_FFT

Realtime audio analysis in Python to extract audio features from streaming audio and send them over OSC to any client app.

What it solves

This project provides a low-latency bridge between live audio input (like a microphone or soundcard) and creative applications. It solves the problem of getting processed, "ready-to-use" audio data—such as beat triggers, frequency bands, and tempo—into tools like VJ software, game engines, or custom scripts without requiring complex signal processing code in those apps.

How it works

The server captures raw audio and performs all heavy signal processing—including filtering, FFT analysis, and onset detection—in optimized worker threads using NumPy and SciPy. It then broadcasts this data in two ways:

  • OSC (Open Sound Control): A high-speed, low-latency stream for real-time performance tools.
  • WebSockets: A two-way channel that allows you to control settings (like band ranges or sensitivity) from a browser-based UI while receiving data updates.

Who it’s for

It is designed for creative coders, VJs, and developers who need to synchronize visuals or game logic to live audio. It is ideal for users of TouchDesigner, Max/MSP, Unity, or p5.js who want a "plug-and-play" source of audio features that stays fast even on low-power hardware like a Raspberry Pi.

Highlights

  • Low Latency: Targets 8–15 ms end-to-end latency.
  • Ready-to-use Features: Outputs auto-scaled band energies (low/mid/high), onset triggers for kicks/snares/hats, and a calculated BPM.
  • Browser-based Control: Includes a UI to tune filters, save presets, and toggle settings in real-time.
  • Efficient: Uses allocation-free callbacks and vectorized C-optimized paths to ensure the audio thread remains stable under load.

Related

  • Project
  • Project
  • Project
  • Project