tags:

views:

578

answers:

4

Hello,

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?

+1  A: 

I found this article on the Adobe Developer Connection site: Generating sounds dynamically in Flash Player 10. I just skimmed it, but it looks like it's based on ways you can tweak a sample.

And here's another one.

Doug Kaye
Gah! I knew this, but couldn't find the url :)
Simon Buchan
+1  A: 

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.

fenomas
+1  A: 

Flash 9 has no support for dynamically generated sound, but (I can confirm) it's possible to hack around that limitation:

linky

A: 

This questions is quite old, but I thought I'd post a link to some AS3 audio experiments I've been working on. Source code is available for nearly all of them. http://labs.makemachine.net/

jeremynealbrown