Audio Visualization with ActionScript 3.0
January 14th, 2008 : Nik RowellAs many of you know, I’ve been spending a bit of my time exploring the cool features in ActionScript 3.0 – some new, some not. Lately, I’ve been intrigued by the SoundMixer class which has a special method, computeSpectrum(), that essentially takes a snapshot of the wave of a streaming sound (or an embeded sound, but I’m talkin’ 100% code here)…
The finer details quickly boil down to binary data, but the power of this is the potential to create audio-powered animations in Flash.
After a refresher in Trigonometry, some tortellini, and a late night (or early morning), I’m pleased to present latest ActionScript 3 experiment!
The variables controlled by the audio are the line thickness, line length and line color. I encourage you to watch for a while – it gets quite a bit more dramatic – you even start seeing some yellows and blues.
I considered adding a function to click and stop the sound. This would show the animation without the influence of the streaming audio, but I figured then most people would view the experiment for maybe 10 seconds before closing the window.
If you let it run for about 5 minutes, you’ll see what the animation looks like when it’s NOT under the influence. Plus, when you watch for a while, you just kind of get sucked in. For those readers who are runners, it’s a lot like running on a railroad track and staring at the tiles below – you instantly get tunnel vision. Check it out!
(don’t worry, they were exempt railroad lines
)
Tags: ActionScript, AS3, Code, Cool, Experiments, Flash













January 14th, 2008 at 10:01 am
Very nice, and indeed hypnotic. I would like to see this with a music track selector so we can see how this visualizes different genres of music. For instance; classical, rock, and R&B.
Keep up the great work!
January 14th, 2008 at 10:18 am
Must…resist…subliminal…messages…
January 15th, 2008 at 9:13 am
Could you resist? Or did you get sucked in?…
The subliminal messages are supposed to say:
“BUY … NIK … STARBUCKS … BUY … NIK … STARBUCKS …”
March 29th, 2008 at 2:34 am
[...] realize it’s been a while since my last flash post on Audio Visualization with ActionScript… but don’t worry – I haven’t been taking a break. Very much the [...]
March 31st, 2008 at 2:33 pm
[...] an effort to simplify audio visualization experiments with ActionScript 3.0, I’ve developed a SoundData class. The class’s main attraction is centered around the [...]
April 22nd, 2008 at 10:14 pm
Cool- wonder how you could use this with a playlist i.e playlist.xml instead of .mp3.