我正在尝试将动画同步到特定BPM的音乐.我尝试过使用Timer但是在处理小间隔时(毫秒)并不准确.我做了一些阅读,发现了另一种使用小型静音音频文件和SOUND_COMPLETE事件作为计时器的方法.
package { import flash.events.Event; import flash.events.Eventdispatcher; import flash.media.sound; import flash.media.soundChannel; import flash.net.URLRequest; public class BetterTimer extends Eventdispatcher { private var silentSound:Sound; public function BetterTimer(silentSoundUrl:String):void { super(); silentSound = new Sound( new URLRequest(silentSoundUrl) ); silentSound.addEventListener(Event.COMPLETE,start); } public function start():void { this.timerFired( new Event("start") ); } private function timerFired(e:Event):void { dispatchEvent( new Event("fire") ); var channel:SoundChannel = silentSound.play(); channel.addEventListener(Event.soUND_COMPLETE,timerFired,false,true); } } }
这仍然没有留下来. Flash Player是否具有声音准确性?
解决方法
原文地址:https://www.jb51.cc/flex/174372.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。