mBeierling Posted June 4, 2015 Share Posted June 4, 2015 I am just starting with phaser and have built Pong as my first project to digg into it. There is one problem I just can't solve: If I test the game locally the audio plays, if I publish it to my webserver, the audio does not play.I sense it may have to do something with access rights (do I maybe need to add an htaccess?), or the web server settings are not correct. My dev environment: Visual Studio 2013, Typescript, Phaser 2.3.0. If you need any further details (e.g. from my web hoster) to tell me what's going wrong, please don't hesitate to ask. Game on the web server: http://games.martinbeierling.de/pong/Sound that should play when the ball hits the player: http://games.martinbeierling.de/pong/assets/hit.wav The code is working, as it plays it correctly when I test it locally by running it from Visual Studio in Google Chrome. -> preload the assetsfunction preload(): void{ game.load.audio("hit", "/assets/hit.wav"); game.load.audio("explode", "/assets/explode.wav");}-> in create, add the soundshitSFX = game.add.sound("hit");explodeSFX = game.add.sound("explode");-> at the triggers, play the soundshitSFX.play(); Quote Link to comment Share on other sites More sharing options...
rich Posted June 5, 2015 Share Posted June 5, 2015 I'd suspect your web host doesn't have a suitable mime-type set-up for WAV files. As wav files don't work in lots of browsers (IE included) you'd probably be safer moving to something more common instead. Personally I'd use m4a AND ogg, then you'll cover them all. Quote Link to comment Share on other sites More sharing options...
mBeierling Posted June 5, 2015 Author Share Posted June 5, 2015 I converted the sounds to .ogg, but still no sound on the web server. I also tried to add an htaccess with this content:AddType audio/x-ms-wma .wmaAddType application/ogg .oggBut: Still not working. I guess I will have to contact my hosting service. Quote Link to comment Share on other sites More sharing options...
rich Posted June 6, 2015 Share Posted June 6, 2015 What does it say in the Network panel of dev tools? Does it download the ogg files ok and just not play them? Or is there an error there? 404? CORS error? etc Quote Link to comment Share on other sites More sharing options...
sdfgdsfgdfg Posted September 16, 2016 Share Posted September 16, 2016 (edited) Hey. I'm having the same problem. Tried ogg, mp4 and wav. On both github pages and my personal site I'm getting 'phaser.js:74719 GET http://MYSITE.co.uk/assets/sounds/MYSOUND.ogg 404 (Not Found)' Edit: looks like the problem was that my Sounds folder started with a capital S, in the code I was using a small s. Is this a linux thing? Edited September 16, 2016 by An Actual Crowbar Quote Link to comment Share on other sites More sharing options...
themoonrat Posted September 16, 2016 Share Posted September 16, 2016 Yes, Linux has a case sensitive file system, so be careful with paths and filenames! sdfgdsfgdfg 1 Quote Link to comment Share on other sites More sharing options...
sdfgdsfgdfg Posted September 16, 2016 Share Posted September 16, 2016 15 minutes ago, themoonrat said: Yes, Linux has a case sensitive file system, so be careful with paths and filenames! Ok thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.