I was playing around with ActionScript 3.0’s new SoundMixer.computeSpectrum() method last night, and managed to build this simple example:

var url:String = "";
var request:URLRequest = new URLRequest(url);
var s:Sound = new Sound();
s.addEventListener(Event.COMPLETE, completeHandler);
var song:SoundChannel =;
song.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
var ba:ByteArray = new ByteArray();

var gr:Sprite = new Sprite();
gr.x = 20;
gr.y = 200;

var time:Timer = new Timer(50);
time.addEventListener(TimerEvent.TIMER, timerHandler);

function completeHandler(event:Event):void {;
function soundCompleteHandler(event:Event):void {
function timerHandler(event:TimerEvent):void {
SoundMixer.computeSpectrum(ba, true);
var i:int;;, 0xFF0000);;, 0);
var w:uint = 2;
for (i=0; i<512; i+=w) {
var t:Number = ba.readFloat();
var n:Number = (t * 100);, 0, w, -n);

(** Sorry about the lack of formatting. I’m working on getting the blog restyled, and adding a bunch new AS2 and AS3 examples.)

UPDATE: Tom Green wrote a great article on the SoundMixer class over on Community MX, check it out: Sound Visualization in Flash CS3.