Jump to content

ogg in android browser


Yanifska
 Share

Recommended Posts

Hi,

 

I am having trouble playing ogg on android stock browser.

The game will play fine, but no music.

The sound will play fine on android chrome though, or ios with m4a.

this.game.load.audio('gameMusic', ['assets/audio/sneaking.ogg', 'assets/audio/sneaking.m4a']);

I have tried a  few random  quality settings for the ogg that didnt works

However the ogg file in this link works (on the android device of course), so I downloaded it and it wont work in my game neither.

 

How can I debug / fix that ?

 

thanks !

Link to comment
Share on other sites

Android stock doesn't support webaudio so it is trying to play your file through HTML5 audio tag as fallback. There's nothing wrong with the ogg audio file, but due to the nature of sound played through the audio tag rather than web audio it will behave differently, eg sounds can't be preloaded, will have lots of lag, only one sound at a time, etc. Depending on what you are trying to do with it it's most likely your requirements are conflicting with the restricted capabilities of the sound engine in this mode.

Link to comment
Share on other sites

I haven't used Phaser a lot myself but when I last looked at its audio engine it was designed to handle switching between web audio and HTML audio tag transparently so in theory you shouldn't have to do anything and it should just work. The fact that it isn't working suggests that you are most likely doing something that will only work with web audio. I would suggest having a quick look at the Phaser source to see if you can identify where it is failing.

Or set up a bare bones test project with a button that plays a sound and see if this works in the android stock. If it does, use that to work out where your game is going wrong.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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