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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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