Jump to content

Music Loading issue


SpriteWrench
 Share

Recommended Posts

Hey Everyone

 

So I have an issue.  I'm currently loading music at my load screen as seen below:

 if (this.ready===true && this.cache.isSoundDecoded('someChords') ) {         //this.ready=true;         //hide loading css         document.getElementById('ball').style.display = 'none';         //show game         document.getElementById('tapjuggler-game').style.display = 'block';         this.game.state.start('menu');                 }  

However, I'm finding that its taking forever on mobile devices (PC seems fine). I'm trying my best to troubleshoot the problem but I'm completely unsure of what to do.  Is the file too big? Is there another way to "wait" for the file to start playing before moving to the next scene? Any help would be appreciated.

 

Link to comment
Share on other sites

Use shorter music?

 

Seriously... the decoding time for ogg/m4a is tiny compared to mp3, so if it's still taking ages to actually decode then you need to look at how you're encoding it, or just how long it is in the first place. There are many different ways to encode an audio file, lots of different bit rates, codecs, etc. Whatever you've picked your mobile obviously isn't very happy about, so try others.

 

Nick an audio file from another html5 game that decodes / plays fast for you and then look at how it was compressed and copy those settings.

Link to comment
Share on other sites

Use shorter music?

 

Seriously... the decoding time for ogg/m4a is tiny compared to mp3, so if it's still taking ages to actually decode then you need to look at how you're encoding it, or just how long it is in the first place. There are many different ways to encode an audio file, lots of different bit rates, codecs, etc. Whatever you've picked your mobile obviously isn't very happy about, so try others.

 

Nick an audio file from another html5 game that decodes / plays fast for you and then look at how it was compressed and copy those settings.

 

Thanks.  I think i'll try and do just that.  Just wanted to make sure there wasn't something small optimization wise programtically I was overlooking. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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