复制代码
- varmySound:Sound=newSound();functionsineWaveGenerator(event:SampleDataEvent):void{for(varc:int=0;c<8192;c++){event.data.writeFloat(Math.sin((Number(c+event.position)/Math.PI/2))*0.25);event.data.writeFloat(Math.sin((Number(c+event.position)/Math.PI/2))*0.25);}}mySound.addEventListener(Event.SAMPLE_DATA,sineWaveGenerator);mySound.play();
欢迎光临 仓酷云 (http://ckuyun.com/) | Powered by Discuz! X3.2 |