Jump to content

Sound problem (and questions) in Cocoonjs


kidos
 Share

Recommended Posts

Hi,

I'm using cocoon 2.1.1 and phaser 2.2.1

 

I tried to add music to my game

// Loading musicgame.load.audio('loopGameStart', 'assets/music/GameStart.mp3');
// Playing musicmusic = game.add.sound('loopGameStart',1,true);  // key, volume, loop music.play('',0,1,true);  //marker, position, volume, loop, forceRestart

Everything works great in chrome but in Canvas+ on cocoonjs I'm getting a warning "Phaser.Loader error loading file: loopGameStart from URL null". It seems like it can't load the mp3 file without a reason...

 

Also I have a few questions not related to the problem:

1. Which format works best? wav? ogg? mp3? what's the different beside the file size? Is there a suitable format for cocoonjs?

2. I saw in the forum some are using 2 files likes:

game.load.audio('music', ['file.mp3', 'file.ogg']);

What's the reason to do that?

 

 

Thanks!

Link to comment
Share on other sites

wav has the biggest filesize.  mp3 is not entirely free, ogg is available for everyone without a license..  so ogg is my favorite option and it works with cocoonjs

 

i didn't know you can load two files together.. the only reason i can think of to do that is to allow the browser which one to use..  not every browser supports ogg for example

Link to comment
Share on other sites

wav has the biggest filesize.  mp3 is not entirely free, ogg is available for everyone without a license..  so ogg is my favorite option and it works with cocoonjs

 

i didn't know you can load two files together.. the only reason i can think of to do that is to allow the browser which one to use..  not every browser supports ogg for example

 

Thanks.

What do you mean not entirely free?

 

Also, any idea why I'm getting url problem?

Link to comment
Share on other sites

OK thanks.

 

For my problem, it seems like cocoonjs doesn't accept mp3 files, so I should provide him also ogg as fallback (as you said)

 

This one fixed my problem

game.load.audio('music', ['file.mp3','file.ogg']);
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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