AS3WavSound (AWS) extends the generic Sound class in Flash and adds support for playing back WAVE data. AWS uses a Wav decoder that converts ByteData into mono/stereo, 44100/22050/11025 samplerate, 8/16 bitrate sample data, that is playable by the Sound class using the SampleDataEvent technique.
So you embed a .wav file as a ByteArray with mimetype ‘application/octet-stream’ and AWS will be able to decode this and playback this sound.
Sample
public class Demo { [Embed(source = "assets/drum_loop.wav", mimeType = "application/octet-stream")] public const DrumLoop:Class; public function foo():void { var drumLoop:WavSound = new WavSound(new DrumLoop() as ByteArray); drumLoop.play(); } }
was cool buddy,
thanks
Thanks, man!
Nice blog, by the way, I just added it to my feeds 😉
Hello guys,
Can you help me a little bit with this library. I try to play audio files with different samples rate, but it allways plays it at 44.1kHz. How can i play with different samples rate ?
Hi, there! I never used AS3WaveSound in my projects so far, so I am not able to help you. I think you can find some answers in the project’s docs or you can report a bug if you really think it is broken.