     private function create(id:int):void {
         sounds[id] = {
             instance: new Sound(),
-            buffer: new ByteArray(),
+            buffer: [],
             channel: null
         };
         sounds[id].instance.addEventListener(SampleDataEvent.SAMPLE_DATA,

     * Buffers some audio
     */
    private function buffer(id:int, bytes:String):void {
        for (var i:Number = 0; i < bytes.length; i++) {
            var sample:Number = (bytes.charCodeAt(i) - 32767) / 32767;
            sounds[id].buffer.writeFloat(sample);
            sounds[id].buffer.writeFloat(sample);
        }
    }

    /**

    private function handleSampleData(id:int):Function {
        var cursor:Number = 0;
        return function(event:SampleDataEvent):void {
            var bytesWritten:int = 0;
            while (bytesWritten < MAX_SAMPLE_SIZE
                && sounds[id].buffer.length > 0
            ) {
                var frame:ByteArray = sounds[id].buffer.shift();
                event.data.writeBytes(frame, 0, frame.length);
                bytesWritten += frame.length;
                frame.clear();
            }
            var pad:int = MIN_SAMPLE_SIZE - bytesWritten;
            var reps:int = Math.ceil(pad / silence.length);
            for (var i:int = 0; i < reps; i++) {
                event.data.writeBytes(silence, 0, silence.length);
            }
        };
    }
