2007年5月17日星期四

Get Sound Spectrum Information

Using ActionScript 3 you can now obtain sound spectrum information from audio played through Flash. This lets you create visualizations like those seen in popular in media player applications. The class that provides this information is the SoundMixer class (flash.media.SoundMixer). It's computeSpectrum method (static) places sound spectrum information in a ByteArray instance which can then be used to generate a visualization.

ActionScript Code:

// play sound...
var spectrumInfo:ByteArray = new ByteArray();
SoundMixer.
computeSpectrum(spectrumInfo);
// spectrumInfo is now a byte array with sound spectrum info

0 评论: