Delayed sound on Android devices?

0 favourites
  • 14 posts
From the Asset Store
Best soundtracks for any game. High quality and engaging assets.
  • EDIT:

    The sounds are delayed on my Samsung Galaxy S4, even on web projects like the Scirra audio effects test. This problem carries over to CocoonJS.

    ORIGINAL POST:

    In my project I have included .m4a, .wav, and .ogg files for each sound, and they are all pre-loaded. I exported my C2 project to CocoonJS, compiled it, and installed it on my Samsung Galaxy S4.

    The sounds are horribly delayed, up to a second, though the graphical performance is a smooth 60 fps. Any ideas on what's going on with the audio?

  • Try pre-loading the sounds at the start of the layout. That should help.

  • I forgot to mention that they are pre-loaded. It doesn't seem to make a difference.

  • Ah yes - I see you even mentioned that in your first sentence....!! (edit - or was that the edit?)

    Dumb questions then - I presume that there is no delay when you play in on your computer/laptop and that this delay of up to 1 second only happens in cjs on your mobile? What about if you preview over LAN onto your phone using chrome for android, does that make a difference? The S4 should be able to take it and it could, of course, be a bug in cocoonjs.

  • Hehe, that was the edit

    There isn't any delay on my computer but surprisingly, over LAN I get the same delay as on CocoonJS! That's very disappointing. What could be going on?

  • Could you try on a different mobile perhaps? Could be your handset... If you don't want to post a capx, could you image an event set where the sound is played - I can't imagine what might be causing it but it's possible there could be a delay caused by the way the sounds are played in the events. With it playing correctly on your computer my suspicions are looking at your phone at the moment...

    Edit - although it's an S4 - so maybe it's something in the events that is causing the sound trigger to delay on mobile only...

  • I appreciate your help man. Just had a friend test it on his Galaxy Note which is a couple years old - he didn't say which version. But the sound was apparently delayed on there too, using both Chrome and Firefox. Weird! These things are a bit frustrating

    My events are structured as follows:

    On Collision with 'Wall' --> Audio: Play Bounce not looping at volume 0 db (tag "")[/code:38qliout]
    It's similar for every time I play the audio. Nothing seems to be particularly wrong with the way I've coded this.
  • Just had a thought - if you're using physics, that might be the cause of the problem - box2d physics in HTML5 (in my opinion) is rather slow and clumsy on collisions whith current tech, so any sound delay might be caused by the high workload associated with a collision in physics (if using physics, does the game stutter ever so slightly then as well at that time?). If the physics appears ok but the sound delay is a pain, maybe you could create different non-physics families and test for a collision between them instead for the trigger? I've tried adding invisible collision objects to sprites in the past to pre-warn the event system that a collision is imminent, so sprite/sound creation doesn't get delayed too much by a collision (I gave up because I thought physics was too hesitant anyway). You could also try asm.js physics and plan to export using crosswalk, if that proves to be better in chrome?

    If you're not using a physics then I'm at a loss...

  • Thanks for all the insight. Unfortunately, I'm not using physics and the sound delay also occurs on this: http://www.scirra.com/labs/audioeffects/

    It works fine on the computer, but on Chrome on my Samsung Galaxy S4 the sounds are delayed by half a second or more. What a bummer.

  • Maybe submit a bug report to Ashley, that seems to be the fastest/surest way to get stuff fixed in this engine -

    I remember my first bug report wasn't filled out that great, but my next few actually got a lot of stuff fixed for me. Ashley is usually really good about fixing stuff if you give him a good bug report.

  • That's not a bad idea. I'll verify that the sound is delayed across multiple phones, and then I'll probably fill out a bug report. Thanks!

  • Is no one else having this issue? It can't just be me. If you've got an Android device, could you please go to the audio test page with your phone browser (Chrome preferably) and see if there's any delay in sound playback?

    If there is, then please post your phone model and operating system in the bug thread I started for this issue. I really appreciate it!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I have the same problem and here Ashley's anwser

  • This seems to be an issue with particular devices, especially Samsung devices. On my phone, for example, I've tried some AAA sort of games that also have this delay. There are also some, like Cut The Rope, that don't have this delay, which means they used Android audio a different way either intentionally (to avoid the delay) or it just happen that way.

    Unfortunately, I don't think this is ever going to be resolved for our phones, so we'll have to accept it. Don't worry, half the people I've tested my game on don't even notice that anything's delayed

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)