Audio Visualization with ActionScript 3.0

January 14th, 2008 : Nik Rowell

As 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.

Audio Visualization with ActionScript 3.0

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:

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • ThisNext
  • Furl
  • Reddit
  • Slashdot
  • Technorati

6 Responses to:
“Audio Visualization with ActionScript 3.0”

  1. a gravatarNicholas Longtin

    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!

  2. a gravatarCarrie Downing

    Must…resist…subliminal…messages…

  3. a gravatarNik Rowell

    Could you resist? Or did you get sucked in?…

    The subliminal messages are supposed to say:

    “BUY … NIK … STARBUCKS … BUY … NIK … STARBUCKS …”

  4. a gravatarTechnology Translated » Blog Archive » Fields of Purple - experiments with Papervision3D

    […] 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 […]

  5. a gravatarTechnology Translated » Blog Archive » SoundData: Facilitating Audio Visualization Experiments

    […] 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 […]

  6. a gravatarxmontelid

    Cool- wonder how you could use this with a playlist i.e playlist.xml instead of .mp3.


Leave a Reply:

Subscribe without commenting