Jump to content

Audio crashes Galaxy S4 stock browser


Recommended Posts

I have noticed that my games created with Phaser are crashing in Galaxy S4 stock browser. They work just fine in any other browsers, even in other Android devices stock browser.



I don't have a Galaxy S4 myself to do the tests so I asked someone else to do these for me. We couldn't manage to get a JavaScript console shown in this browser (USB debugging doesn't seem to work, about:debug doesn't work either). After that we did some tests and noticed that when the sounds of the game are disabled, it works!

In my games I use Phaser to detect WebAudio support. If the browser has WebAudio support, I will use both sounds and music. If it doesn't, I would just use a music track on the background. It seems that this stock browser does support WebAudio, because we get sounds, but somehow it makes the game crash. Disabling sound but not music works as well.


Has anyone else experienced something like this?

I'm using Phaser 2.0.4 in these games.





PS: We have reasons to believe this may as well be happening with Galaxy S3, but we couldn't test it yet.

Link to comment
Share on other sites

The samsung stock browser does not support web audio. Perhaps if you are incorrectly detecting that web audio is supported and trying to utilise it when it is unavailable then this could be what is crashing your game? Or trying to play sounds that haven't loaded because elsewhere Phaser correctly detected that web audio was not supported and did not load them?

Link to comment
Share on other sites

Hey alex, thanks for your help.

Well, if device.webAudio is false, I will just load different musics as a single audioSprite and play that. Even the enable sound button is greyed out in this case. That's not happening, so I'm pretty positive that Phaser is detecting WebAudio as available for this device.

I make some of my Android tests on a Galaxy Tab 3 10.1. The stock browser there works just as intended, it does not have WebAudio, so it just enables music.

I checked Phaser WebAudio detection, and it's as simple as this:

this.webAudio = !!(window['webkitAudioContext'] || window['AudioContext']);

So, maybe this is failing somehow? Knowing Android stock browser, specially Samsung versions, it would not be surprising that it is a browser problem anyway.



If someone knows something else about this it would really help!

Link to comment
Share on other sites



yes the stock browser with very new android versions can play webaudio (because that stock browser is more or less a older chrome version I think...).

But there are some devices + android versions - maybe like your s4 - that tell you that they can play webaudio, but it doesn't really work (no sound, crashes,... ). So I think you have to exclude such devices manually and force the audio tag.



Link to comment
Share on other sites

  • 10 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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