I’m looking to use procedurally-generated sound and music in a Flash program I’m writing. I haven’t found anything in the ActionScript 3.0 reference manual that shows how to do this. Is this possible? Have any third-party tools been developed that can do this? Or can Flash/ActionScript communicate with external programming languages that are more suited for this sort of thing?
I’m looking to use procedurally-generated sound and music in a Flash program I’m writing.
Share
The ability to play dynamically generated/modified sound is new to Flash 10, so make sure you’re using the newest version of the AS3 reference, or you won’t see the necessary APIs.
As for examples, check the docs on SampleDataEvent to see an example of playing a sound generated from scratch, and the docs on Sound.extract() have a useful example of playing a loaded MP3 where the data is being modified in real time.
To answer your last question I don’t think there are any good ways to load this off to another technology. AS3 should give you all the basic functionality you need (i.e. access to the decoded sound as a byte stream), but I don’t think it has much in the way of high-level functions (say, to change octaves or do fourier transforms) – not yet anyway.