wombat Posted May 16, 2014 Share Posted May 16, 2014 On android I can play my game in Chrome and Firefox browsers, but on the stock browser there's no sound. Any ideas where I should start looking? I have my sounds encoded as ogg and mp3. Edit: the game in case someone is interested Link to comment Share on other sites More sharing options...
alex_h Posted May 16, 2014 Share Posted May 16, 2014 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 More sharing options...
wombat Posted May 16, 2014 Author Share Posted May 16, 2014 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 More sharing options...
Yanifska Posted January 20, 2015 Share Posted January 20, 2015 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 More sharing options...
wombat Posted January 20, 2015 Author Share Posted January 20, 2015 @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 More sharing options...
BunBunBun Posted April 9, 2015 Share Posted April 9, 2015 Yanifska, have you found the solution with audio and samsung galaxy tab 3 ? Link to comment Share on other sites More sharing options...
Yanifska Posted April 9, 2015 Share Posted April 9, 2015 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 More sharing options...
mxmlb Posted April 10, 2015 Share Posted April 10, 2015 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 More sharing options...
BunBunBun Posted April 15, 2015 Share Posted April 15, 2015 the solution is crazy simple:just need to make tap event before make sound.play(); for example via:game.input.onDown.addOnce(this.playMusic); Link to comment Share on other sites More sharing options...
Yanifska Posted April 16, 2015 Share Posted April 16, 2015 thanks !!! I'll check that when I come back to itcan't wait no more ! Link to comment Share on other sites More sharing options...
Yanifska Posted April 27, 2015 Share Posted April 27, 2015 @BunBunBun it works ! thanks manI would not have thought about that because ios request to have the user touch the screen before playing the soundthe trick was that the android native browser need the sound to played directly after the inputthats why the audio was working on iOs but not stock androidmakes sense ? Link to comment Share on other sites More sharing options...
Recommended Posts