Background music stops playing a minute into the game
Oct 29 2018 09:54 AM
Well, the solution might be very simple. If you have the following code in your app, then just remove it.
local function stopAudio() audio.stop( backgroundMusicChannel ) end timer.performWithDelay( 60000+math.random(-5000,5000), stopAudio )
If you don't happen to have this exact, or very similar piece of code in your app, then please share enough of your code, as well as the audio file, to replicate that issue so that others may try to help you. Sharing a sample project with the issue, zipping it and uploading it here would be the easiest method of getting help.
I'm sorry if I came across as a jerk, but you cannot realistically expect others to be able to help you if you only tell them that "something doesn't work and I don't understand why, please help me".
--outside the scene functions
local music = audio.loadStream("Automation.mp3")
Well, that's still not much code to go by. All you do is create two buttons and add functions for turning the sounds on or off. But since neither function is actually ever used, I don't know what happens. Do you leave them there and touch them by accident at approx. 1min mark? No idea.
I would recommend that you read roaminggamer's post at https://forums.coronalabs.com/topic/55780-ask-a-better-question-get-a-better-answer/.
Also, please insert code by using the <> button to make it easier to read.