1 stable release
1.0.1 | May 13, 2025 |
---|
#119 in Audio
119 downloads per month
25KB
564 lines
rvsp
rvsp is a lightweight audio spectrum visualizer made in Rust, drawing inspiration from techniques used in WebAudio API. It is GPU accelerated through OpenGL (ES), supporting Linux and Raspberry PIs.
This uses PipeWire and Wayland (via winit and glutin), which is not available anywhere except Linux. Since my primary workstation is Linux, I have no plans to port it to Windows or Mac.
Installation
PipeWire development headers must be installed through the package manager of your distribution, if it packages them separately.
Git
$ sudo apt install libpipewire-0.3-dev
$ cargo install --git "https://github.com/cynthia2006/rvsp" --locked
It installs a binary rvsp
in ~/.cargo/bin
.
crates.io
$ cargo install rvsp
Controls
- ↑ to increase, and ↓ to decrease gain.
- ← to decrease, and → to increase smoothing time constant (0 < τ < 1).
"Suckless" Philosophy
This app has no mechanism for dynamic configuration; if you want to tweak something, you can tweak it by changing the constants defined in src/main.rs
.
Suppose you want increase the bandwidth: you open src/main.rs
; modify MAX_FREQ
to, say, 12000
.
-const MAX_FREQ: i32 = 10000;
+const MAX_FREQ: i32 = 12000;
Smoothing time constant
Smoothing time constant (τ) is a parameter that controls how data is smoothed exponentially over time; a kind of lowpass filtering. In this context, it controls the responsiveness of the spectrum—higher the values, the less it is responsive. It defaults to 0.7
, which in my personal experience, provides the best experience.
Spectrum
The spectrum is linear, both on the frequency and the amplitude axis. The frequency range is limited between 50 to 10000 Hz, chiefly considering visual aesthetics. Generally speaking, you won't be interested in the higher parts of the spectrum.
To comprehend the theory that underpins the mechanics of this program, i.e. STFT (Short-Time Fourier Transform), read this guide.
Dependencies
~10–32MB
~463K SLoC