O'Reilly logo

Away3D 3.6 Cookbook by Michael Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Visualizing sound in 3D

If you decide to start developing a flash mp3 jukebox, you will be happy for sure to add some sound visualization effects. With the combination of Away3D and ActionScript 3.0 SoundMixer class, you can achieve some really cool effects. So let's have some fun.

Getting ready

Set up the Away3D scene using AwayTemplate as your base class.

Make sure you include in your assets folder s3.mp3 and dofText.png, which can be found in this chapter's assets folder. Alternatively, you can use your own mp3 sound track or a bitmap file for sprite texture.

How to do it…

In the following program, we create a field of Sprite2D objects around a sphere which receives their transformation values from the SoundMixer.computeSpectrum() method:

SoundVisDemo.as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required