Dear Corona community,
Students of mine have programmed a timer to update every 100 milliseconds. Their code appeared to work until we tried adding music to it. We know that the track is 2’ 12" long yet it appeared to finish playing at the 95 millisecond mark. I set a timer on my mobile and it we found that it was taking 2 minutes for the timer to show 95 milliseconds. Below is the code for the timer. We have tested it on the simulator and on a Samsung Galaxy S3. Any help will be appreciated.
[lua]local maxTime = 1200
local time = 0
local timeDisplay = display.newText(string.format("%.1f seconds", time), 190, 20, native.systemFont, 20)
local function countTime()
time = time + 0.1
timeDisplay.text = string.format("%0.1f seconds", time)
end
local bgTrack = audio.loadStream(“CathysSong.mp3”)
audio.play(bgTrack)
timer.performWithDelay(100, countTime, maxTime)[/lua]
[import]uid: 22300 topic_id: 33078 reply_id: 333078[/import]