Just another sound visualizer that takes the DFT of sound samples. The visualizer produces a lot of rapidly changing colours and lights, so please do not use this program or look at the example below if you are sensitive to those type of things.
This project uses the SDL2 library, which you can install here. You must, of course, also have a C compiler, and Make.
- Download or clone this repository
- Open a terminal in the directory location of this file, and type
make
.
Currently this program only supports wav files. To play a wav file, type:
./sound_view /path/to/sound-file.wav
The upper portion of the window contains the visualization of the sound wave data in time. The colour bars at the bottom correspond to the DFT of the sound data. The height and colour of the colour bars are determined by the magnitude and complex argument of the corresponding DFT amplitudes. Only the positive frequency terms are shown, in ascending order from lower to higher frequency.
- Space bar - pause playback
- up or down keys - increase or decrease height of colour bars
- left or right keys - increase or decrease width of colour bars
FFT algorithm:
- Wikipedia - Cooley–Tukey FFT algorithm
- Numerical Recipes Chapter 12
- Wolfram MathWorld - Fast Fourier Transform
Info on how to read a .wav file header:
Playing audio in SDL:
Colour hue to RGB values: