KevinnFtw Posted May 1, 2014 Share Posted May 1, 2014 Hi all, So I'm trying to add background music to my game, and I've provided phaser with a .ogg and a .mp3 file so it has a fallback.Problem is, the audio doesn't play/load at all in Google Chrome (latest build). In Firefox the audio is working fine for me. I've looked at some examples on examples.phaser.io and added the audio the same way they did there, like this:game.load.audio('backgroundMusic', ['assets/audio/TakingFlight.mp3', 'assets/audio/TakingFlight.ogg']);Later in the javascript I play the music using this code:backgroundMusic = game.add.audio('backgroundMusic');backgroundMusic.play('', 0, 1, true);Any suggestions / ideas? I've added the mp3 file of the background music in this post, wasn't allowed to upload the ogg..TakingFlight.mp3 Link to comment Share on other sites More sharing options...
rich Posted May 1, 2014 Share Posted May 1, 2014 Plays fine for me in Chrome 34 and Chrome 36 (Canary). All I did was take the examples/audio/play music file and edit the mp3 to yours instead. Link to comment Share on other sites More sharing options...
KevinnFtw Posted May 1, 2014 Author Share Posted May 1, 2014 Weird, sometimes it works in Chrome. But most of the time it doesn't.. Well, Google Chrome is acting strange for me lately.. Thanks for your answer! Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted August 4, 2014 Share Posted August 4, 2014 Probably the problem is that chrome does not allow to load sounds from the file system (file:///), else you have to access to an http:// sound file. Link to comment Share on other sites More sharing options...
Recommended Posts