In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Amen Break PNG

The Amen Break - http://www.youtube.com/watch?v=5SaFTm2bcac

I used this command ( http://sox.sourceforge.net/ ) to convert it to raw audio:
sox ~/music/samples/amen-short.wav -t raw -e signed-integer -b 16 -c 2 amen.raw

and converted to png with http://wonderfl.net/c/mEon . anybody know how to make SiON loop it?
Get Adobe Flash player
by yonatan 14 Aug 2011
/**
 * Copyright yonatan ( http://wonderfl.net/user/yonatan )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/z7r5
 */

package {
    import flash.display.*;
    import flash.events.*;
    import flash.net.*;
    import flash.system.*;
    import org.si.utils.ByteArrayExt;
    import org.si.sion.*;

    public class AmenBreak extends Sprite {
        private var _samples:Vector.<Number> = new Vector.<Number>;
        private var _driver:SiONDriver = new SiONDriver();

        public function AmenBreak() {
            var url:String = "http://assets.wonderfl.net/images/related_images/3/39/39a4/39a4a6ce8a3e260ce6a141f9aa2c8fa894b0f80a";
            var loader:Loader = new Loader;
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoad);
            loader.load(new URLRequest(url), new LoaderContext(true));
        }

        private function onLoad(e:Event):void {
            var bae:ByteArrayExt = new ByteArrayExt;
            bae.fromBitmapData(Bitmap(e.target.content).bitmapData);
            bae.endian="littleEndian";
            for(var cnt:Number = bae.length/2; cnt; cnt--) {
                _samples.push(bae.readShort() / 0x8000);
            }
            _driver.setSamplerWave(0, _samples);
            _driver.play();
            _driver.playSound(0);
        }
    }
}