Jump to content

Sound Issue - Long delay after pageload before sounds play


Bligglenuber
 Share

Recommended Posts

Got a game that plays sound as it should do on desktop, and iOS is pretty good too.
However Chrome on Android is proving difficult. (Been testing primarily with a Galaxy S6 but the problem is common across a range of devices)

The issue I am experiencing is that when the first sound tries to play there is a delay in the region of half to a whole minute before it eventually makes a noise. After the first sound plays the rest seem to work fine.

We have a screen that needs user interaction to get through that is supposed to in the process unlock sound but for the purposes of this I've enabled the chrome://flags/#disable-gesture-requirement-for-media-playback so that it doesn't have any impact on the this issue. I can confirm that if I get the game to play a sound after it finishes the initial load with this flag enabled it will do so without user interaction, eventually - there is still the long delay.

The game is using webAudio and sound spriting. All the sounds are added to phaser and spriting maps set up before any attempt to play sound is made.

The sound file is being successfully loaded and is in ogg format to minimise decode time.

If the game is left alone for a while before trying to play a sound the sound plays without delay.

Does anyone recognise this problem? Any advice at trying to resolve it would be greatly appreciated.

Link to comment
Share on other sites

Okay, upon further investigation it turns out that the cause of the delay is simply that Chrome on Android takes that long to decode sounds. Some numbers and insight into that can be found https://code.google.com/p/chromium/issues/detail?id=424174 but it looks like this issue has been fixed on Chromium as 06/01/2016 so hopefully it won't be long before mobile Chrome sees the improvement too.
(Which happens to be ~x4 faster decode time)

(Thanks to megmut for pointing me to the isDecoding property in Phaser)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...