How charl024/term_auviz works
term_auviz is a terminal audio visualizer. The user launches the app; its frame loop polls input, retrieves captured audio, processes complete FFT-sized blocks into frequency magnitudes, then draws and renders the visualization. Capture discovers an audio node through PipeWire, receives stream buffers, mixes channels to mono, and queues samples in a ring buffer. The graph also shows frame pacing and the input and graphics modules; their implementation was not sampled, so their internal behavior is not expanded.
Main entry points: app.c Frame Loop · pipewire_backend.c Stream Capture · state.h App State · graphics.c Visualization
Components 13
Application
- Program Entry
src/main.c - Frame Loop
src/app.c - Frame Timing
include/time_helper.h - Input Handling
src/input.c - App State
include/state.h
Audio Capture
- Stream Capture
src/pipewire_backend.c - Audio Ring Buffer
src/ringbuffer.c
Signal Processing
- FFT Processing
src/audio_processing.c
Terminal Display
- Visualization
src/graphics.c
Other components
- User
- PipeWire
- Notcurses
- Terminal
Connections 17
- User → Program Entry: launches
- Program Entry → Frame Loop: calls
- Frame Loop → Frame Timing: checks frame time
- Frame Loop → Input Handling: polls input
- Input Handling → App State: updates
- Frame Loop → Stream Capture: starts and reads
- PipeWire → Stream Capture: provides audio
- Stream Capture → Audio Ring Buffer: writes samples
- Stream Capture → PipeWire: discovers and connects
- Audio Ring Buffer → Stream Capture: returns samples
- Frame Loop → FFT Processing: processes audio
- FFT Processing → App State: writes spectrum
- Frame Loop → Visualization: draws frame
- App State → Visualization: provides spectrum and layout
- Frame Loop → Notcurses: renders frame
- Visualization → Notcurses: draws with
- Notcurses → Terminal: displays