Skip to content

nhrx1337/SpecTUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPECTUI

📋 Overview

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.

Features

  • 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

⚙️ Dependencies

Debian/Ubuntu:

sudo apt-get install build-essential libportaudio-dev libsndfile1-dev libfftw3-dev libncurses5-dev libncursesw5-dev

Arch-Based:

sudo pacman -S base-devel portaudio sndfile fftw ncurses

📥 Build & Install

  1. Build
make
  1. Install (optional):
sudo make install
  1. Uninstall:
sudo make uninstall

Usage

Run 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

Implementation details

  • 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

About

SpecTUI is a lightweight terminal audio visualizer in C

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published