Here is the script :
import beat.BeatEngine; import beat.BeatEvent; var sound:Sound = new YourSound(); sound.play(); var engine:BeatEngine = new BeatEngine(); engine.addEventListener(BeatEvent.LOW_BEAT, lowHandler); engine.addEventListener(BeatEvent.MED_BEAT, medHandler); engine.addEventListener(BeatEvent.HI_BEAT, hiHandler); function lowHandler(e:BeatEvent):void { doSemethingLow(e.power);//action for low frequency beat detection } function medHandler(e:BeatEvent):void { doSemethingMedium(e.power); //action for medium frequency beat detection } function hiHandler(e:BeatEvent):void { doSemethingHigh(e.power); //action for high frequency beat detection }
No comments:
Post a Comment