FlashPlayer 10 audio fun
After seeing these experiments over at everyday flash, I felt compelled to make something using the fp10 version of as3dmod.
With this example as a starting point, I decided to make an audio visualiser that uses FFT data to drive a 3d modifier.
The implementation is fairly simple, FFT data is used to modify the Y position of the verticies at one end of the "pixel tunnel". With each frame the modifier adds a new set of data and shifts the previous ones down a row, reducing their values slightly each time.
A couple of bitmap filters process the display to add the decaying vertical trails and there is some simple beat / peak detection used to change the visual effects in time to the music.
To use the app, select an mp3 file using the right-click menu - it will load, be parsed, and start playing. Enjoy...
But wait, there's more!
As an added bonus there are more fp10 specific features packed into this little app - after loading an mp3 try the arrow keys and moving the mouse about...
Audio processing: It seemed wrong not to implement some, so I took a couple of effects processors from an fp10 audio framework I've been working on (more on that later) and added them to the output stream.
Local mp3 loader: The app uses a version of the lovely mp3 wrapper from flexible factory to parse the locally loaded mp3. I also modified the wrapper's internals to implement id3 tag parsing using ben stuki's id3 parser. So, if the mp3 you load has ID3 information, it will be parsed and displayed.
Note: Some id3 tags aren't being parsed correctly at the moment, I'm aware of this I'll get to it eventually. In the meantime if anyone fancies improving any of the code then feel free - post suggestions/ improvements back here - I'll update the sources and make the new package available.
Also: If you're running this in the debug player the performance will be poor and on slower systems it could hang/crash your browser - consider yourself warned.
Update: 01/04/2009
I'm aware there are issues when running this on a Mac, I'm working on them and will have a fix up shortly.
Update: 02/04/2009
The Mac compatability issues should be sorted now. It seems that in the Mac version of player 10 you can't access the file extension of a FileReference. I'm reading it from the filename now.
Controls
- Left - Sample rate reduction (toggle)
- Right - Resonant Filter (toggle)
- Up - Simple Delay (toggle)
- Down - Extra visualisation (toggle)
- F1/F2 - Volume down/up









first of all great work…
how can i play .mp3 file via webURL can you bit explain. thanks for the help
Thanks in advance
Thanks for the feedback
Unfortunately the current version doesn’t allow you to load an mp3 from an http address – just the local filesystem.
It wouldn’t be too troublesome to implement though, I’d suggest looking at the code in LocalAudioPlayer.as and modifying it for your needs. Look in the
mp3LoaderCompleteHandler– this is where the loaded mp3 is assigned to a channel and the playback is started.Thanks for this nice sample
Your work on audio process is very interesting.
[...] 详见作者博文。不过原作者并没有加上对ID3信息的解析,“Annoyingly, all the id3 tags get stripped using this method, and I’m far too lazy to parse these too. ”这里提供的是Mike Almond整合了ID3解析的源码。 [...]