
No preloader. channel faders fade in when loaded
This is my first approach of writing a sound engine for flash. Hobnox was the inspiration…
The audio engine works with byte arrays that hold the data for audio channels that are fed into a pixel bender kernel and mixed down to a stereo channel. It uses the sampledata event to write data to the audio card’s buffer.
My hypothesis was that byte arrays are the fastest way to hold and process data collections. I’ve used sound.extract() to get the raw sound data and store it in a vector of bytearrays. When the sampledata event is dispatched the extracted sound data is written into a another vector of bytearrays which represent the audio channels. This data is then mixed down to one stereo channel via pixel bender and written to the sound-buffer.
It turns out that bytearrays are not the fastest solution since reading and writing with bytearrays is expensive. http://blog.andre-michelle.com/2005/as3-optimations-suggestions/
click to hear in action
right click to view source (check core.AudioEngine)