SPECTUI is a compact terminal audio visualizer written in C. It plays audio via PortAudio and decodes files with libsndfile, computes real‑time FFTs with FFTW (single precision), and renders a live spectrum using ncurses (menu + panel). The app is lightweight and intended for terminals.
- Play WAV files and visualize spectrum in real time
- Ringbuffer-backed producer/consumer audio pipeline
- Hanning windowed FFT running in a background thread
- Simple ncurses menu for basic actions
Debian/Ubuntu:
sudo apt-get install build-essential libportaudio-dev libsndfile1-dev libfftw3-dev libncurses5-dev libncursesw5-devArch-Based:
sudo pacman -S base-devel portaudio sndfile fftw ncurses- Build
make- Install (optional):
sudo make install- Uninstall:
sudo make uninstallRun with a audio file:
./spectui <path/to/file>Supported/common file types:
- WAV (.wav)
- FLAC (.flac)
- Ogg Vorbis (.ogg) — if libsndfile built with vorbis support
- AIFF (.aiff, .aif)
- MP3 (.mp3)
- CAF (.caf)
Controls:
- Arrow keys — move menu selection
- Enter — activate selected menu item
- q — quit
- FFT size: 1024 (FFT_SIZE)
- Frames per PortAudio callback: 1024 (FPB)
- Ringbuffer capacity: 1<<16 frames
- Spectrum stored as decibels: 20 * log10(magnitude + 1e-8)
- Window: Hanning applied before FFT
- Threads: one FFT worker thread reads from ringbuffer and updates spectrum; main thread handles ncurses UI and audio stream control
- Libraries linked: PortAudio, libsndfile, FFTW (fftw3f), ncurses (menu, panel), pthreads, math