Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flash.media.*;
- import flash.utils.*;
- import flash.events.*;
- trace("location X",getTimer());
- var buff:ByteArray=new ByteArray();
- var s:Sound=new Test();
- var read:uint;
- do {
- read=s.extract(buff,4096);
- } while(read==4096);
- trace("location Y",getTimer());
- var s2:Sound=new Sound();
- s2.addEventListener(SampleDataEvent.SAMPLE_DATA,gen);
- var pos:uint=buff.length;
- function gen(e:SampleDataEvent):void {
- for(var i:uint;i<8000 && pos > 0;++i,pos-=8) {
- buff.position=pos-8;
- e.data.writeFloat(buff.readFloat());
- e.data.writeFloat(buff.readFloat());
- }
- }
- s2.play();
- trace("location Z",getTimer());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement