peoplesbeer Posted October 7, 2015 Share Posted October 7, 2015 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. 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 More sharing options...
trasheater Posted October 7, 2015 Share Posted October 7, 2015 It looks like you are using Phaser v2.0.1. I would suggest that you update this to the latest version. Link to comment Share on other sites More sharing options...
peoplesbeer Posted October 7, 2015 Author Share Posted October 7, 2015 Woops, you're right. Replaced the phaser.min.js to 2.4.3-version but still no luck. Link to comment Share on other sites More sharing options...
trasheater Posted October 7, 2015 Share Posted October 7, 2015 When I navigate to the file URL on your site I don't get an audio file. I am not sure if the URL is incorrect of if you have some CMS installed that prevents you from loading those file types. mtornqvist.se/mmgame/assets/sounds/mm-title.mp3 Link to comment Share on other sites More sharing options...
icp Posted October 7, 2015 Share Posted October 7, 2015 When I go here : http://www.mtornqvist.se/mmgame/assets/sounds/mm-shot.ogg I get a website page not a sound.Check your .htacces file on the server, or uninstall any CMS you have there. Link to comment Share on other sites More sharing options...
jmp909 Posted October 8, 2015 Share Posted October 8, 2015 yes this is a server mime type issue.... your audio files are being served as ...Content-Type: text/htmlwhereas eg your PNGs areContent-Type: image/pngand your json isContent-Type: application/jsonit'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 http://www.mtornqvist.se/mmgame/pretend.ogghttp://www.mtornqvist.se/mmgame/pretend.html Link to comment Share on other sites More sharing options...
peoplesbeer Posted October 8, 2015 Author Share Posted October 8, 2015 Wow, I've never experienced that before! Thanks for heads up, now I just need to solve it. Go go gadget google! jmp909 1 Link to comment Share on other sites More sharing options...
peoplesbeer Posted October 8, 2015 Author Share Posted October 8, 2015 So I checked my mime-config which already has the necessary formats... Link to comment Share on other sites More sharing options...
peoplesbeer Posted October 8, 2015 Author Share Posted October 8, 2015 Finally.Seems like there was some sort of permission issue after all. Instead of chmod -r 644 I was told to do a chmod -x on the sound folder. And now, it works. Yes! Thanks for your input guys! Link to comment Share on other sites More sharing options...
Recommended Posts