views:

536

answers:

2

I need to create a basic bar chart distribution in ActionScript 2.0 based on sound output. I realize that ActionScript 3.0 has a very nice sound visualizer class SoundMixer.ComputeSpectrum but the limitations of my project require me to use ActionScript 2.0. Im wondering if you know of

A. Any third party libraries that I can use or purchase to create basic visualization effects based on sound output in AS2

B. Whether it is possible to create the sound visualizer in ActionScript 3.0 and somehow import/embed the AS3 file/swf in the AS2 file but allow the AS3 file to read from the AS2 sound

+1  A: 

A: AS2 cannot analyze the sound in real time. Your best bet is to run it through some software that can export the values to a file, load the file, and visualize the numbers somehow.

B: AS3 runs under AVM2 while AS1/2 run under AVM1. It is not possible to load an AVM2 file into AVM1. You could create an AS3 file that loads the AS2 file and gets the spectrum and visualizes it. Any audio going out (except microphone, with the current flash player) will be analyzed. Sending the numbers back to AS2 for whatever reason becomes hacky (using LocalConnection) and most likely will cause sync issues etc.

Antti
A: 

Antti is right, as2 simply cannot do it. But I recall a tool that converted the sound to data that you can stream at the same rate as the sound. It's not perfect, but that's one option. I don't remember what the tool was called, but maybe you can do some googling with that in mind.

Daniel