I'm using the following method to dispatch a sound in X times/minute (X is determined through bpm, which is a NumericStepper object)
var mainTimer:Timer = new Timer(60 / (bpm.value * 1000),0);
mainTimer.addEventListener(TimerEvent.TIMER, fl_TimerHandler,false, 0, true);
mainTimer.start();
function fl_TimerHandler(event:TimerEvent):void
{
metroTransform.volume = vol;
flash.media.SoundMixer.soundTransform = metroTransform;
metroChannel = metro.play();
mainTimer.delay = 60 / bpm.value * 1000;
}
According to this http://www.metronomeonline.com/ the sound is not sitting well. Is there something I can do to fix this problem I'm stuck in?
Path to the output file I'm getting: http://conatur.net/metroBig.swf
http://cookbooks.adobe.com/post_Accurate_timer-17332.html might help you.
Hum shouldn't the delay value be
instead of
And as the Time delay values is described in the documentation:
I guess 750 milliseconds would fit be better than 0.00075 milliseconds.
Though, when I test your SWF and set the BPM at 60, it sounds every second without problem so I guess the bpm.value is not what it looks like.
Anyhow, when I open your swf and the "metronomeonline" website on two tabs (or windows) and set them at the same BPM, they sound synchronized to me.