Hello
when my game starts, an 8 sec intro plays and when that is finished, I want to loop the main theme.
[lua]
–in main.lua:
audio.reserveChannels(1)
–in game.lua’s scene:create
musicTrack = audio.loadStream(“audio/gameTheme.wav”)
introTrack = audio.loadStream(“audio/gameIntro.wav”)
–in game.lua’s scene:show
audio.play(introTrack, {channel=1, loops=0,
onComplete=function()
--audio.stop(1) --doesn’t seem to help or do anything
audio.play(musicTrack, {channel=1, loops=-1})
end})
[\lua]
this above demo works, except that musicTrack starts playing by fading in, so there is an audible silence between musicIntro ending and musicTrack fading in. Adding “fadein=0” to the options did not work. How can I resolve this issue?
kind regards
PS
I also tried playing them on different channels, same result.
I also tried to execute audio.play(musicTrack,…) inside a performWithDelay instead of onComplete, but again, the undesired fade-in occured.