#graphic-flex-image-effects-11-Flex-SoundController.ax [swf] [flash] flex
Class to hanldle simple loading and playing back of sounds. This class also surfaces the sound spectrum of the Flash player's current loaded sounds that can be used for visualizations.
Constructor. This sets up an ENTER_FRAME listener on a sprite to be used to help broadcast events when a sound is playing so that a visualization can update each frame. If a file is passed to this constructor, it will be loaded and played.
parameter: file The sound file to request.
Handler for ENTER_FRAME. If the sound is currently playing, a CHANGE event is dispatched.
parameter: event Event dispatched by sprite.
Sets _playing flag to false to prevent further dispatch of CHANGE event. Also dispatches COMPLETE event to listening objects.
parameter: event Event dispatched by @ax-graphic-flex-image-effects-11-Flex-SoundController.
Handler for an error when loading a sound file. Simply redispatches event.
parameter: event Event dispatched by @ax-graphic-flex-image-effects-11-Flex-SoundController.
Attempts to load a sound file.
parameter: file The sound file to load.
Returns a byte array containing the sound spectrum data of the loaded sounds playing in the Flash player. This will include ANY loaded sounds playing, since SoundMixer.computeSpectrum() does not differentiate between channels.
parameter: fftMode Whether to return frequency spectrum data or raw sound wave data.
parameter: stretchFactor The sampling rate used for the spectrum data.
returns: A byte array populated with sound spectrum data.
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.