Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG] Long running/looping sounds don't play after app regains focus

Author
Message
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 15th Jun 2017 17:58
I'm currently seeing a bug on iOS and Android where if you play a sound, then minimise the app by hitting the home button, and then restore the app, the sound is no longer being played. Here's a simple example of the problem (you'll need to provide your own sound file of course).



Is anyone else getting this problem?
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 16th Jun 2017 13:05
this will happen in a lot of apps, not just AGK.
you can account for it with the command GetResumed()
Quote: "Returns 1 if your app has been passed to the background and has just been reactivated. You should activate a pause screen when this happens. On mobile platforms apps will not run whilst they are in the background so that first chance you app will get to receive this notification is when it returns from the background and continues running. Since the user may not yet be ready to continue playing you should check this value and show a pause screen until they are ready. "

and then play the sounds again if GetResumed() > 0
life\'s one big game
spec= 2.6ghz, 1gb ram, 512mb gpu, directx 9.0c, dbpro and classic
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 16th Jun 2017 15:56
Quote: "this will happen in a lot of apps, not just AGK."

Why is that? Is it related to some underlying problem with the platform? It seems to work fine for the music commands, so I imagine it must at least be possible.

Quote: "you can account for it with the command GetResumed()"

Well, kind of. I mean, this will restart it from the beginning, right? And it requires quite a lot of additional book-keeping on my part to get this to work. I guess I will be able to work around it if I really have to, but it will require quite a lot of changes to my code to keep track of all the sounds that are in flight and might need to be restarted, so I'd rather it just worked .

Login to post a reply

Server time is: 2024-11-24 15:08:12
Your offset time is: 2024-11-24 15:08:12