The ability to generate some sort of visual feedback when playing audio is very useful to the user, as they will be able to see that playback occurs even if the device volume has been muted or turned down. Generating visuals from audio is also useful in certain games, or in monitoring audio input levels.
We will load a
MP3 file into a
Sound object. By employing the
SoundMixer. computeSpectrum() method, we can access the actual bytes being played back and construct visualizations with this data using the
Sprite graphics API:
import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.TimerEvent; ...