Audio Delay on Android (Possible fix)

0 favourites
  • 8 posts
From the Asset Store
100+ Musical High Quality Sound Effects for your game!
  • Problem Description

    Audio appears to be delayed when it is played from the sounds folder, however when it is played from the music folder, the delay is much less noticeable.

    Attach a Capx

    Capx is uploaded.

    Description of Capx

    Capx shows two blocks that when clicked play their audio through the two different folders.

    Steps to Reproduce Bug

    • Step 1: Allow audio to preload.
    • Step 2: Play audio from sounds folder by clicking red box.
    • Step 3: Play audio from music folder by clicking blue box. Observed Result There is a significant delay from audio played from sound folder, when played on android devices. Expected Result I would expect both to be played with the same delay but they are not. Affected Browsers
      • Chrome: (YES)
      • FireFox: (YES)
      • Android Browser: (YES)

    Operating System and Service Pack

    Windows 8.1

    Construct 2 Version ID

    R175

  • I had this problem before. But not anymore. I keep the sound in the sound folder and the music in the music folder and it works like a charm. The sound in the sound folder is downloaded the first time they are played while the music in the music folder is streamed and that is why you see the difference in the delay.

    I start my game with a loading layout and after the loading is complete I go to the main menu layout.

    Then I Usually start by putting the play audio event before any other event. Like on collission wih X play audio followed by the other events like damage or other code.

    I also delete all other file formats of every sound, only keeping the .ogg files.

    In the new version of construct I think preload sound is forced by default and no preloading is required. But correct me if I'm wrong.

    If you are experiencing this while testing on network or in browser on your android device then I think this is the problem. I also see this delay when I test the game thorugh my network. But as soon as I compile and wrap it with CocoonJS the delay disappears.

    So if you haven't compiled it and wrapped it yet. Try that and see what you get.

    This woked for me when I made this simple android game:

    https://play.google.com/store/apps/deta ... appz.dropz

  • Thank you for your quick and very useful response. I tried everything that you said and it did not work but I noticed that when I downloaded your game and played the audio was delayed on my phone. (Very nice game by the way, the soundtrack is awesome.)

    I also noticed that when I compiled this Capx provided above and wrapped it up in cocoonjs that the audio delay between the two boxes was identical.

    So, I have come to the conclusion that the audio delay problem is in my phone itself.

    For those interested I have an HTC Droid DNA Android Smartphone.

  • Can't reproduce on a Nexus 5 with Android 4.4.4 running Chrome with preview-over-wifi. The latency appears identical. Anyway we don't control the audio stack, it's built in to the phone, and some older Android devices add high latency in the OS. There's nothing we can do about that.

  • Can't reproduce on a Nexus 5 with Android 4.4.4 running Chrome with preview-over-wifi. The latency appears identical. Anyway we don't control the audio stack, it's built in to the phone, and some older Android devices add high latency in the OS. There's nothing we can do about that.

    Ahhh, I see. Thank you for looking into this for me Ashley. Construct 2 is an incredibly powerful and amazing tool.

    Keep up the good work!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I had this problem before. But not anymore. I keep the sound in the sound folder and the music in the music folder and it works like a charm. The sound in the sound folder is downloaded the first time they are played while the music in the music folder is streamed and that is why you see the difference in the delay.

    I start my game with a loading layout and after the loading is complete I go to the main menu layout.

    Then I Usually start by putting the play audio event before any other event. Like on collission wih X play audio followed by the other events like damage or other code.

    I also delete all other file formats of every sound, only keeping the .ogg files.

    In the new version of construct I think preload sound is forced by default and no preloading is required. But correct me if I'm wrong.

    If you are experiencing this while testing on network or in browser on your android device then I think this is the problem. I also see this delay when I test the game thorugh my network. But as soon as I compile and wrap it with CocoonJS the delay disappears.

    So if you haven't compiled it and wrapped it yet. Try that and see what you get.

    This woked for me when I made this simple android game:

    Hey I downloaded your app. Cool app, I like the quotes. Question, I'm still kinda confused. How did you preview your loading screen to see if it was working. And when I put my audio on preload, I would wait for about 10 mins, and I would hear nothing.

  • frenzyace Thank you. It was my first ever game so its far from perfect

    Do you mean you have to wait for about 10min on a black screen or is the game still running? And is this happening while you preview or after you have compiled the game?

  • frenzyace Thank you. It was my first ever game so its far from perfect

    Do you mean you have to wait for about 10min on a black screen or is the game still running? And is this happening while you preview or after you have compiled the game?

    Basically I have to wait for like 5 mins on the loading screen for the game to start. I set my audio on preload. Also I'm confused, how o I know which one should go in the Sounds and Music folder. Do all the m4g go in the music folder, and all the ogg go in sound folder.

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