Hi All,
I can’t seem to get my loop working on this audio clip. It is probably very simple and i’m just overlooking it as i’m new to Corona. Any help would be greatly appreciated and rewarded with an emjoi! Here is my code.
local piano2 = display.newImage(“button1b.png”, 40, 50);
piano2.status = “waiting”;
local piano2Sound = audio.loadSound(“piano2.mp3”);
function piano2:tap(e)
if(self.status == “waiting”) then
audio.setVolume( 0.5 )
audio.play(piano2Sound,{
channel = 1,
loop = -1,
onComplete = function(e)
self.status = “playing”;
end
});
elseif(self.status == “playing”) then
audio.pause(1);
self.status = “paused”;
elseif(self.status == “paused”) then
audio.resume(1);
self.status = “playing”;
end
end
piano2:addEventListener(“tap”,piano2);