复制代码代码如下:var mySound:Sound = new Sound();
function sineWaveGenerator(event:SampleDataEvent):void {
for ( var c: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();
以上就是在Flash Player播放器里播放声音的两种方法介绍,希望对大家有所帮助!