我可以播放这样的哔声:
private var beep:Sound = new Sound();
private function beepInit():void {
var beepHandler:Function = new Function();
beepHandler = function(event:SampleDataEvent):void {
for (var i:uint = 0; i < 2048; i++) {
var wavePos:Number = 20 * Math.PI * i / 2048;
event.data.writeFloat(Math.sin(wavePos));
event.data.writeFloat(Math.sin(wavePos));
}
}
beep.addEventListener(SampleDataEvent.SAMPLE_DATA, beepHandler);
}
在应用程序启动时,我调用 beepInit();
要播放,请调用: beep.play();
这是连续的声音。我怎样才能做到前。500 毫秒。短哔声?