Jump to content

Android: Sound works in Chrome but not in stock browser


wombat
 Share

Recommended Posts

I would hazard a guess that you are only hearing the sounds working when the game runs in a browser that supports WebAudio. The stock browser does not support Web Audio, it only supports HTML5 sound which is much more limited. As for specifically why the sound in your game is not working for HTML5 audio I couldn't tell you without rummaging through the code.

Link to comment
Share on other sites

Thank you. Since I believe the .ogg files are loaded as first choice, I guess there's something with the encoding of these that the native browser doesn't like. Not loading these (using just mp3) works, until I figure out what is wrong with the oggs.

 

EDIT: Turns out I didn't change that at all, I only thought I did. Instead, sound seems to have started working mysteriously on it's own accord. Hm. Sorry for wasting your time folks, if I come up with something useful I'll post it here.

Link to comment
Share on other sites

  • 8 months later...

Hi wombat,

I am running in the same issue.

I am using ogg and m4a, I got it running in chrome/android and safari/ios.

However stock android browser won't play the file.

I test on a samsung galaxy tab 3 lite.

 

Could you share the ogg setting of your files ?

I'll probably try and use different compression settings I guess
 

thanks

Link to comment
Share on other sites

@Yanifska: I'd like to help but I don't remember. The .ogg files were created in Audacity, and if I load one back it says Stereo, 44100Hz, 16-bit PCM. I don't know if that's the setting your'e asking about. The link above is still valid though if you want to have a look at the .ogg files yourself.

Link to comment
Share on other sites

  • 2 months later...

Hi there,

 

unfortunately I didn't see wombat last answer and I didn't dig more the subject lately.

I am stuck on some freelance stuff for now.

I'll update when / if I find a solution.

 

so good luck in the meanwhile, keep me updated If you have more success than me ;)

Link to comment
Share on other sites

Make sure your sounds are loaded & decoded before playing them.

 

Decoding takes ages on Android for web audio, and it's even worse with the audio tag. In the most cases it will only load a few bytes of your sounds, and make a request to the resources when you need to play it, thus there could be an important latency.

 

You can also check the value pendingPlayback of your sound in order to know if it's in the process of playing it.

Link to comment
Share on other sites

  • 2 weeks later...

@BunBunBun it works ! thanks man

I would not have thought about that because ios request to have the user touch the screen before playing the sound

the trick was that the android native browser need the sound to played directly after the input

thats why the audio was working on iOs but not stock android

makes sense ?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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