Included among several nifty new features in Flash 10 (currently in beta) is the ability to write audio data in realtime. Here's a quick code example of how to set this up:
1 public function init():void { 2 var buffer:Sound = new Sound(); 3 buffer.addEventListener("sampleData", onSamplesCallback); 4 buffer.play(); 5 } 6 7 private function onSamplesCallback(event:SampleDataEvent):void { 8 var i:int = 0; 9 for (i = 0; i < BUFFER_SIZE; i++) { 10 event.data.writeFloat(samples[i].left); 11 event.data.writeFloat(samples[i].right); 12 } 13 }Samples is an array of audio waveform data, which can be mixed, mashed, reverbrated, convoluted, synthesized, visualized, and so on at realtime -- reacting to user input. This opens up a world of possibilities for those (albeit few) who are interested in developing applications that integrate web technology with sound and music creation.
Audio programmers have been writing this kind of software ever since processing power could support it, but what is new here is the cross-platform in-everyones-browser web-app-backed capabilities of the Flash platform. What I'd really like to see is an app where users can work with the same audio material simultaneously, collaborating in real time to make music through a powerful but streamlined UI. I haven't quite realized that goal yet, but I have put together a pretty neat demo which is now online here. Check it out, make some music, save your mix to the db.
Here are some great links if you're interested in learning more about flash audio (and some more wicked demos):
http://www.splicemusic.com/
http://www.make-some-noise.info/
http://www.hobnox.com/
by Genís