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.

Android / StopSound doesn't work with AGK Player [ Rare Bug? ]

Author
Message
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 25th Dec 2016 01:53 Edited at: 16th Nov 2017 18:21
Hey guys,

I'm currently working on some kind of Shoot'em Up game ( AGK2 Tier 1 ).
I'm using the AppGameKit Player on my Galaxy S4 to play and test it.

Sometimes (it happens very rarely) when I kill the boss, the sound of the boss doesn't stop playing.

When the boss spawns, I do a


When the boss dies, the following code is executed. Everything works fine but the StopSound command (as said, it happens very rarely)


One wave later, the boss spawns again, and the sound is played again
--> should be 2 instances now, right?
When I kill him then, both sounds stop.

Anyone else experienced a similar problem with StopSound()?

(EDIT)
I was able to reproduce the bug. StopSound() was definitely executed, but ignored.
I did a
ID = PlaySound ( SFX_Move_Boss, 90, 1 )
so I have the handle for GetSoundInstancePlaying()

When the bug occurs, and the sound continues playing although it should have stopped, and the same sound is played again when the next boss spawns, I have 2 sounds playing simultaneously.

At this time ( when the 2 sounds are playing at the same time )
GetSoundsPlaying() returns 2
GetSoundInstancePlaying() returns 1

When I kill the boss now, StopSound() stops both sounds.

Maybe that helps finding the bug. Seems to happen only when using the AppGameKit Player. I need to compile an .apk and test it


PSY LABS Games
Coders don't die, they just gosub without return
Jumbly
8
Years of Service
User Offline
Joined: 4th Nov 2015
Location:
Posted: 30th Jan 2017 21:38
I had this issue in my program, and ended up using the following code

while GetSoundsPlaying(PianoOffset+intW1) > 0
StopSound(PianoOffset+intW1)
endwhile

Seems to have sorted the issue for me
I miss my ZX Spectrum
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 2nd Feb 2017 14:47 Edited at: 16th Nov 2017 18:21
Thanks for the reply, Jumbly.

Did this issue occur when using the AppGameKit Player, or when running an *.apk on your phone?


PSY LABS Games
Coders don't die, they just gosub without return
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 5th Feb 2017 20:38 Edited at: 16th Nov 2017 18:22
Confirmed the bug.

I compiled an *.apk and installed it on my Galaxy S4.
Played about 1 minute, and the bug occurred.

The sound file is an .ogg file with a duration of 1.7 seconds.

I load it with LoadSoundOGG and play it (unlimited loop) with PlaySound ( SFX_Move_Boss, 90, 1 )

It's probably an OGG problem that occurs with perma-looped sounds.


PSY LABS Games
Coders don't die, they just gosub without return
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 19th Feb 2017 18:21 Edited at: 16th Nov 2017 18:22
Update:

Same bug just occurred again, although I had replaced the *.ogg sound with a *.wav sound


PSY LABS Games
Coders don't die, they just gosub without return
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 2nd Apr 2017 04:49 Edited at: 2nd Apr 2017 19:14
I also have this problem, with both sounds and music when they are played on a loop, on both AppGameKit player and exported .apk, even with wav files.

If I use
while GetSoundsPlaying(PianoOffset+intW1) > 0
StopSound(PianoOffset+intW1)
endwhile

the WHILE loop will loop forever, as if the sound cannot be stopped.
Also cannot be stopped with StopSoundInstance( iID )
But I noticed that if we try to stop the sound at different time when the sound is playing, it can be stopped. Not sure what part of the sounds will enable stopping.

I did not encounter the same problem with musics.

Should we report this as a bug?

Login to post a reply

Server time is: 2024-04-18 13:04:43
Your offset time is: 2024-04-18 13:04:43