A somewhat-modern tool for precisely rendering real-time audio analysis.
audec is a real-time audio visualizer intended for utility and information density more than entertainment (it is the (au)dio (dec)ompiler). It is intended as a FOSS alternative to another proprietary real-time waterfall-rendering analyzer often touted by Linux musicians, and attempts to loosely emulate its appearance.
Some music--note the stereo separation, broadband noise, pitch-space mapping...
An example configuration of the lovely ZynAddSubFX soft-synth:
A clipping sine wave with multiple harmonics (note that the views can be resized fluidly):
- Cargo (normally part of your Rust toolchain);
- A host version of PortAudio (or your platform's build tools,
e.g.,
build-essential
, so that Rustportaudio
can build it on its own); - For Linux: ensure you have ALSA's "development files" as well (e.g.
libasound-dev
), as that seems to be the default on this platform; - SDL2's development files.
On Linux and perhaps other POSIX platforms, these should be available in your favorite package manager (unless you're doing things "from scratch"). Cygwin is recommended for Windows users, or you could try your hand at building and installing from source.
cargo build
builds the binary (somewhere into the target
directory), cargo run
runs it. Pass --release
to either to disable runtime checks for performance.
Without command line arguments, sane defaults are assumed:
- Your default input device (usually a built-in microphone, or whatever would be preferred for audio recording);
- The selected device's default sample rate;
- An 800x200 scope and an 800x600 spectrogram/waterfall;
- A Hann-window FFT of 1024 samples;
- Zero-crossing search of 1024 samples;
- A -5dBFS spectral bias and a range of 30dBFS.
All of these can be overridden from the command line; use --help
to see the
options. (If you're using cargo run
, make sure you put a --
before
--help
.)
Since you'll probably want to analyze the signal coming from your computer,
PortAudio on Linux most often uses ALSA, which does not have an in-built
concept of "monitor devices" (inputs derived from signal sent to an output
device); you'd normally have to use snd-aloop
for that. However, modern audio
routing daemons often provide their own:
- PulseAudio users can use
pavucontrol
to change the "Recording stream" to one of its monitor devices, presuming you have the monitor module loaded (this is the default)--you can probably also usepactl
from the command line if you need to; - JACK users can route things however they want, using
jack_connect
,jack_disconnect
,jack_lsp
, and any of the graphical patchbays likeqjackctl
orpatchage
; - PipeWire users can do the same with
pw-link
or graphical patchbays likehelvum
, as well as tools compatible with either of the above through its own emulation (e.g. withpw-jack
)--you can also set thePIPEWIRE_NODE
envvar to your audio output node ID (seepw-cli dump short Node
) so that the ALSA Pipewire plugin connects to the monitor automatically.
Your mileage may vary on other platforms.
Help wanted! Report missing features and bugs on the GitHub issue tracker. Some known issues, for example:
- No scale yet (on either axis) in the spectrum/waterfall view;
- No dynamic adjustment of parameters;
- Could use more/better window functions;
- Pure software-rendering of waterfall limits performance;
- Changing window size dumps historical data;
- No prebuilt binaries;
- No changing the default color scheme; ... and probably others I'm unaware of.
If you're feeling motivated, pull requests are also welcome :)
This software is hereby released under the "Rust license", which is also known as the "dual Apache/MIT license"; specifically, you may choose, at your option:
- Apache License, Version 2.0 (mirrored here); or
- MIT license (mirrored here with placeholders).
Contributions Submitted for inclusion into the Work by You (as per supra Apache license) are assumed to comply with the terms of the selfsame Apache license without any additional terms or conditions (see id., section 5) and without patent encumbrance (id., section 3).