I have an audio that gets lower and lower after a few page transitions (for example, I go to other page then I return to the audio page). The more I go back and forth, it gets almost inaudible.
I tried to replace loadStream by loadSound, remove fade, force volume to its higher value and NOTHING is avoiding this issue. Ideas?
[code]
– Code created by Kwik - Copyright: kwiksher.com
module(…, package.seeall)
function new()
local numPages = 5
local menuGroup = display.newGroup()
local sound_02_aud078 = audio.loadSound( “sound_02.wav” )
local curPage = 3
local disposeAudios
local disposeTweens
local drawScreen = function()
local Layer1
Layer1 = display.newImageRect( “p3_Layer1.png”, 1024, 768 );
Layer1.x = 512; Layer1.y = 384; Layer1.alpha = 1
menuGroup:insert(Layer1)
menuGroup.Layer1 = Layer1
local function flip (event)
if event.phase ==“ended” then
if event.xStart < event.x and (event.x - event.xStart) >= 30 then
if (curPage > 1) then
disposeAudios()
disposeTweens()
director:changeScene( “page_”…curPage-1, “moveFromLeft” )
end
elseif event.xStart > event.x and (event.xStart-event.x) >= 30 then
if (curPage < numPages) then
disposeAudios()
disposeTweens()
director:changeScene(“page_”…curPage+1, “moveFromRight”)
end
end
end
end
Layer1:addEventListener(“touch”, flip)
end
drawScreen()
disposeAudios = function (event)
audio.stop(); audio.dispose(sound_02_aud078); sound_02_aud078 =nil
end
disposeTweens = function (event)
cancelAllTweens();
cancelAllTimers();
cancelAllTransitions();
end
local myClosure_sound_02_aud078 = function()
audio.play(sound_02_aud078, { loops=0 } )
end
timerStash.newTimer = timer.performWithDelay(0, myClosure_sound_02_aud078, 1)
return menuGroup
end
[/code] [import]uid: 4883 topic_id: 16520 reply_id: 316520[/import]