/colourful-sound-bars

Just another music visualizer.

Primary LanguageCMIT LicenseMIT

Colourful Sound Bars

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.

Prerequisites

This project uses the SDL2 library, which you can install here. You must, of course, also have a C compiler, and Make.

Installation

  • Download or clone this repository
  • Open a terminal in the directory location of this file, and type make.

Usage

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.

Keyboard Controls

  • 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

References:

FFT algorithm:

Info on how to read a .wav file header:

Playing audio in SDL:

Colour hue to RGB values: