Sound cuts out now and again on android

 I have a mobile game demo getting closer to completion, but there’s a possible glitch with sounds for android…

To avoid latency with the audio api, I’m using media.playEventSound for sound effects like bullets, explosions, etc. and media.playsound to loop an engine thruster sound effect.  All sound effects are pre loaded.

It all seems to work fine, but then, every once in a while, sound seems to cut out entirely, then back to normal again after a few seconds (sometimes longer) - has any one else encountered this?

The android apk is at http://8up.uk/demo/

I did have that happen to me when I was using a lot of audio channels at the same time.  I had a game where each tile that dropped would make a “clack” sound, and if many dropped at the same time, the audio on other sound effects would stop.  My solution was to limit the clack sounds to a few channels… didn’t make a difference to the user since the number of overlapped sounds during a large tile drop could not be heard anyway.

This seems like a recent bug entered in one of the latest builds. I have a working game which I update every 5-6 months. when running on build 2555 music is fine. however, on one of the recent builds, such as 2620, the music is being cut everywhere. will need to check which exact build this error entered.

Thanks for the replies.  @schizoid2k - although the old media api doesn’t have channels, I’ll check that I’m not playing more sounds than required.  @rune7 - thanks for the tip - I’ll try a few alternative builds (including 2555) and see if that works.

I did have that happen to me when I was using a lot of audio channels at the same time.  I had a game where each tile that dropped would make a “clack” sound, and if many dropped at the same time, the audio on other sound effects would stop.  My solution was to limit the clack sounds to a few channels… didn’t make a difference to the user since the number of overlapped sounds during a large tile drop could not be heard anyway.

This seems like a recent bug entered in one of the latest builds. I have a working game which I update every 5-6 months. when running on build 2555 music is fine. however, on one of the recent builds, such as 2620, the music is being cut everywhere. will need to check which exact build this error entered.

Thanks for the replies.  @schizoid2k - although the old media api doesn’t have channels, I’ll check that I’m not playing more sounds than required.  @rune7 - thanks for the tip - I’ll try a few alternative builds (including 2555) and see if that works.