Flash 9

This page deals with the new sound functionality that’s incorporated into Flash 9 (aka Flash CS3) and what it means for FlashAmp generally. This information is intended to give current and future FlashAmp users a clear understanding of the basic issues involved.

The Flash 9 authoring application includes real-time spectrum and amplitude functionality via the SoundMixer.computeSpectrum() and SoundChannel.leftPeak()/rightPeak() methods as part of ActionScript 3 (AS3). This capability is built into the Flash 9 player and browser plugins, which were released in June 2006. There is a large number of Flash 9 examples on the web created with the pre-release and release versions of Flash 9 and Flex 2, that show these features in action. Just Google ‘as3 sound spectrum’ or ‘computespectrum’ for more information.

There are two main points that we want to make clear:

  • In many situations, FlashAmp remains an effective solution for the creation of audio visualizations in Flash. In many situations it remains the best option.
  • As a result, Marmalade will continue to maintain FlashAmp and support our existing and future users.

So why should you use FlashAmp instead of the new AS3 methods in Flash 9?

Wide player support

FlashAmp is the best way to create audio-based animations when you need to support Flash player 8 or earlier. FlashAmp data can be used all the way back to Flash player 6, and even Flash player 5 if you’re willing to tweak the array syntax. It will take some time before the Flash 9 player becomes ubiquitous so FlashAmp is the best way to use spectrum and amplitude data in Flash without compromising your audience reach. Adobe maintains a page of statistics for Flash player version penetration.

 

Targeting individual sounds

The new AS3 sound methods analyse every sound playing in your swf at the time they're called. If you have multiple sounds playing simultaneously then the output from these methods will reflect every sound playing – in some cases that will be a problem. If you want to target particular sounds for spectrum or amplitude values then FlashAmp is the better option.

 

Accuracy

The bottom line is that FlashAmp will always give a more accurate representation of the overall sound spectrum and/or waveform than Flash 9’s AS3 sound methods. In many cases, the AS3 methods will be ‘good enough’ but if you need a faithful representation of audio spectrums and waveforms then FlashAmp will give you just that.

All of Flash 9’s new AS3 sound methods take a ‘grab’ of the sound at the instant they're called – there is no way of looking ahead in the sound and they take no account of what has occurred earlier in the sound. FlashAmp, on the other hand, analyses the entire sound in one process and so can use data windowing techniques that give a more accurate representation of the sound as it changes over time; both for spectrum and amplitude data.

It’s possible to see one type of inaccuracy in the AS3 sound methods when you view music with distinct beats that should appear as peaks in the spectrum or waveform – you’ll notice that the AS3 examples will often ‘skip’ the display of some beats because the sound methods either aren’t being called frequently enough, or regularly enough, to catch the changes in the sound.

 

Looking ahead in amplitude and spectrum data

FlashAmp makes it very easy to show and animate entire spectrum plots and waveforms. If you want to do anything similar to this using the sound functions in Flash 9 then you’ll need to pre-process the sound with one of the AS3 methods and store the output. The storage space required can get very big very quickly unless you do some fairly intense secondary processing to reduce the data. FlashAmp avoids this work because it generates data for the entire sound and takes care of all the processing and optimizaton for you. And it will always give you a more accurate representation of the sound, even at low frame rates.

 

Performance

The new AS3 sound methods impose an additional load on the processor, particularly computeSpectrum(), before you start working with the data and drawing/manipulating graphics. The sound analysis is done in software by the Flash player, not at the hardware level. If you are doing other non-audio animations at the same time, or dealing with user interactions, then you may see your swf start to chug and lose responsiveness, especially on machines with slower processors.

Every time you call computeSpectrum(), typically on an enterFrame event, you get back 512 32-bit floating point numbers normalized from -1 to 1. So to do even simple visualizations you’ll need to manipulate this data in real-time (sum to mono, group into frequency bands, etc), which adds more load to the processor.

Using FlashAmp avoids this additional processor load. The analysis load occurs once when you process the sound with FlashAmp and never again.

 

Remote sounds

There are some security issues associated with the use of the new AS3 sound methods and mp3 files on remote servers. You will get security violation errors if you have a swf running that’s implementing one of the AS3 methods and another swf without an open cross-domain policy is running at the same time. It’s possible to detect this situation using the SoundMixer.areSoundsInaccessible() method, but if this returns true then you won’t be able to use any of the AS3 sound methods – even for your ‘local’ swf.

 

Cue points

FlashAmp continues to offer a viable way to implement audio cue points (also known as ‘markers’) within your Flash projects. There is no equivalent functionality in ActionScript 3 (it’s possible to use cue points in flv files, but this is not the same as FlashAmp’s ability to recognize and output cue points embedded in audio files).

 

Normalize

FlashAmp’s Normalize functionality can only be achieved in Flash 9 by pre-scanning an entire sound file and scaling it to fit the range of –1 to 1. If this is not done properly then you will also be boosting the apparent noise floor in the data. FlashAmp provides a simple and accurate solution without noise floor problems.

 


For the reason’s outlined above, and because we’re committed to our current and future FlashAmp users, we will continue to maintain and support FlashAmp. So existing users who have established projects with FlashAmp shouldn’t be concerned – we will continue to honor our original support commitments. And new customers shouldn’t be concerned that they’re buying a product that’s not going to be supported in the future.

We’re not about to pull the plug on FlashAmp – and we have other products in the works that we’re excited about. Marmalade Multimedia has been providing audio utilities for multimedia production for over six years and we still enjoy making software that people use to create great multimedia.

This page will be updated as other information becomes apparent.

'Flash 9' and 'Flash CS3' are trademarks of Adobe Inc.

 

 

 

 

 

home | download | support | order
Copyright © Marmalade Multimedia 2006