The last release of OpenBSD (4.8) includes a new cool feature: a monitoring mode in its audio daemon aucat(1).
Thus, this little hack visualizes anything, what is being played using this new mode, no matter where the sound data came from.
Source: src/spectrogram (depends on sndio, SDL, fftw3)
aucat was renamed into
sndiod. To get it working restart sndiod with flags