We’re facing an unfortunate situation while in development of a flash audio application. This application was first initialized late last year and we invested a healthy amount of hours investigating audio syncronization within flash, and, although Flash does a great job for *most* audio, it’s not hard to overwhelm flash with multiple audio tracks that quickly lose their sync, even after a few seconds.

I believe we’ve covered all our available options. We ensured all the audio tracks were in memory before telling them all to play, but even the small amount of time it takes to run that ‘play’ command (especially if you’re not starting at the beginning of the audio file) delays the next track a teeny tiny bit, and the following tracks a little more, until the final track sounds like shoes in a washing machine.

We tried adjusting the times by measuring the amount of time each track takes, for instance, if we start a timer right before a track plays, then get the time again and find the difference between those two times, we should be able to start playing the subsequent track from that far in and they should, in theory, be aligned. Unfortunately this did not work, and efforts to call this more frequently to continually adjust the audio to a click track we devised resulted in even worse sounding ‘warbly’ audio.

We tried putting audio on the timeline (gah!). Try putting multiple tracks on a timeline and telling any of them to be a stream. The audio sounds poor and garbled.

I fully realize we’re doing something a little outside Flash’s abilities. Its humble roots as an animation tool may be crumbling under the load we’re asking. Perhaps we’ve stumbled upon a limitation here. We did eventually come up with an acceptable solution that seemed about 98% working, but as we built the application up and started asking the CPU for more cycles to render our views and whatnot, the slippage became more apparent.

And that’s exactly why I’m so impressed that we were able to make this work with Flash Player 10. Using the new extract command and sampleData events, we’re now able to stack an awful lot of audio and generate a new dynamic sound. This blows me away, and the sound of a song in perfect sync is, quite literally, a pleasure to hear. Furthermore, I had expected the math to be pretty overwhelming – we are, after all, looping over 8192 samples of 19 tracks and doing addition of the byteArray floats. That’s a lot, but AS3 is more than capable in this department. I am thoroughly impressed by what Adobe has brought to our little Flash Player.

Anyways, the whole point of this post is to give props to Adobe. They really listened to Andre Michelle and Joa Ebert’s Make Some Noise campaign, and have done a remarkable job implementing the community’s desired features. Hopefully the player will be out of beta soon.