Jump to content

No audio in ANY browser? DigitalOcean as host, problem?


peoplesbeer
 Share

Recommended Posts

Hard to set a proper topic to this one but here's the story.

 

Made a small game with Phaser, used everything needed for audio and locally it works like a charm and right of the bat. The sounds are downloaded sfx's and some are probably recorded straight from the original game ( Megaman X ). 

Decided to put it on my website to share and there's no audio what so ever.

 

My first problem was that I was getting a 403 - Forbidden in the console on every audio file. Got help from another member on this forum who told me to chmod 644 the sound-folder on my server (hosted at Digital Ocean), tada.wav - no 403 message! 

But... Still no sound?! No sound in Chrome, Safari or Firefox. I'm not even going to try IE. :P

What I've tried so far except the above:

*Full permission on every audio file.

*Converting .mp3 to .ogg.

*Replacing sounds with other.

*Decoding at page load due to different sizes (some are like 8K and other 1,3MB).

 

Are there any specific limits for Phaser to handle the audio that I've missed?

As for now I feel like the next step are to put it on another hosting page just to see if it works but I dunno, seems like a lot of hazzle...

 

Any ideas what to do? 

I'm just so confused since it's working offline (duuh, locally storage bla bla) but not online. Also, checking the console tells me that the sounds ARE loaded but never fires.

 

Edit: If anyone wants to take a look at the early stage of it and inspect the whole code, here it is: http://www.mtornqvist.se/mmgame/

 

Snippets from my code:

function preload() {    game.load.audio('titleMusic', 'assets/sounds/mm-title.mp3');    game.load.audio('backgroundMusic', 'assets/sounds/mm-gameplay2.mp3')}var backgroundMusic;function create(){    game.physics.startSystem(Phaser.Physics.ARCADE);    var background = game.add.tileSprite(0,0,800,400, 'background');    // Sounds and background music    backgroundMusic = game.add.audio('backgroundMusic');    backgroundMusic.play();}
Link to comment
Share on other sites

yes this is a server mime type issue....

 

your audio files are being served as ...

Content-Type: text/html

whereas eg your PNGs are

Content-Type: image/png

and your json is

Content-Type: application/json

it's what any non existent page returns in that path.

eg these 2 (non-existent) URL's give the same response as the server can't see/serve either of them

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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