PDA

View Full Version : SoundWriter audio generation library



WMarsh
November 21st, 2007, 03:18 AM
Hi, you may or may not find this useful.

http://wayne-marsh.blogspot.com/2007/11/soundwriter-actionscript-3-sound.html

SoundWriter is an Actionscript 3 library that allows you to create Sound objects from your own audio data. That is, you write into an audio buffer (ByteArray) with whatever audio data you want, process it through SoundWriter, and get a Sound object out of it. This is something which isn't provided by Flash 9 directly, but is achievable with a little trickery.

How this library may be of use to you:
Synthesising your own sound effects ahead of time
Creating audio from supplied data
Loading WAV files from binary resources (not possible if you don't have Flash CS3)
Creating music from other sound files not supported by Flash – e.g., a MOD file renderer allowing your game to incorporate music into your game without upping the file size with a 5MB MP3

Dazzer
November 21st, 2007, 03:46 AM
Looks great!

Could you explain though . Why is loading WAV files from binary resources not possible without Flash CS3?

WMarsh
November 21st, 2007, 03:59 AM
I don't know. You can embed MP3s like this:


[Embed(source="sound.mp3")]
private static const soundClass:Class;

but it's not supported for WAV. Crazy, huh? It's especially annoying as MP3 files have silence added to the beginning of them by the encoders, so if you use them as sound effects you find that there's a slight latency before you actually hear anything.

Dazzer
November 21st, 2007, 04:24 AM
Ah okay. But you can import wavs into Flash IDE yeh?

WMarsh
November 21st, 2007, 04:45 AM
Yeah. But a lot of us don't have/use/like it.

Anyway, it's not the primary usage for this sound library :-)

Dazzer
November 21st, 2007, 05:22 AM
I have an idea I want to try using your library ^^

WMarsh
November 21st, 2007, 05:27 AM
Oh? I am excited to see the results!

Kribba
April 28th, 2008, 10:52 AM
Hi

Wayne. The link in your blog doesnt seem to work. Am i right if assuming that your library can create an instance of Sound class from a bytearray?

Kribba
April 28th, 2008, 10:53 AM
Would be veery sweet if that works :)

starpause
April 28th, 2008, 11:38 AM
always great to see sound advancements in AS3!

Andre Michelle and Joa Ebert have also written a module player in as3 ...

http://8bitboy.popforge.de/