Hi,
I have a problem with Corona sometimes not loading my audio.
local audioSpeelt=0
local function Boom(event)
if event.phase == "began" then
if audioSpeelt==1 then
--print ("audio is playing")
else
if audioCounterTable.boomCounter==7 then
audioCounterTable.boomCounter=1
end
local function disposeBoom()
--print("dispose boomAudio")
audio.stop(1)
audio.dispose(boomAudio)
boomAudio=nil
audioSpeelt=0
end
local boomAudio=music(boomAudioTable[audioCounterTable.boomCounter])
if boomAudio ~= nil then
audio.play(boomAudio,{channel=1,onComplete=disposeBoom})
audioSpeelt=1
end
audioCounterTable.boomCounter=audioCounterTable.boomCounter+1
end
end
return true
end
This all works, and when I run and check the memory the memory does not grow.
But when I run this function like 80 times, during a stress test. it gives me the error:
WARNING: Failed to create audio sound(audio/lente/1/boom2.aac)
This happens after around 80 times of tapping the button.
I have several of these functions in my code all. If you tap one 80 times it happens it you tap a combination of them around 80 times it happens.
It cannot load the audiofile for a certain reason. No idea why. In the console when I run it from the ipad itself I get no error message at all. With Corona I at least get that warning. I am all out of ideas at the moment.
[import]uid: 100901 topic_id: 35346 reply_id: 335346[/import]