How To Create a Circular Audio Visualizer
by Ben S. / June 24, 2010
Traditional equalizers are arranged in columns known as bands. Each column has a height representing a sound’s amplitude at specific frequency. It is these amplitudes that give the traditional equalizer its distinct look. But traditional is boring. Who says equalizers need to be linear?
Let’s look at how we can mix it up a bit and create a circular audio visualization.
Audio in FlashIn Flash, the SoundMixer class handles each audible channel within your Flash project. Within the SoundMixer class, analysis of the samples is managed through the static method ComputeSpectrum(). ComputeSpectrum() analyzes the currently playing sound and returns an array of values (between -1 and 1 – or 0 and 1 if FFT is set to true) into a provided byteArray. The values in the array represent the full audio spectrum playing at the moment the routine is called. Within the returned byteArray are 512 sampled values; the first 256 represent the stereo left channel of audio while the second 256 represent the right.
Knowing this, we can utilize and output the values anyway we’d like. In this case we will use our 512 bytes to generate a circular equalizer.