First Timer
totalFadeLength = 6000; (6 secs)
currentVolume = 50;
% per second = 50/6 = 8 1/3
Second Timer
So then in 1000 miliseconds you want to fade 8 1/3% going 1 percent at a time
timerInterval = 1000/8.33333 = 120 seconds
That would mean every 120 milliseconds for 1 second you decrease by 1%




Reply With Quote