Elsa 0 Posted February 1 Report Share Posted February 1 Hi i am nw to phaser and am using phaser 2.6.2 and am trying to run audio files, but i keep getting the same console log Phaser v2.6.2 | Pixi.js | Canvas | WebAudio http://phaser.io ♥♥♥ js/phaser.js:36103 Phaser.Loader - audio[boden]: error loading asset from URL oedipus_wizball_highscore.mp3 js/phaser.js:74259 Phaser.Cache.isSoundDecoded: Key "boden" not found in Cache. js/phaser.js:71363 Phaser.Cache.getSound: Key "boden" not found in Cache. js/phaser.js:71363 2 Phaser.Cache.isSoundDecoded: Key "boden" not found in Cache. js/phaser.js:71363 Phaser.Cache.getSound: Key "boden" not found in Cache. Here is my code: <html> <body> <script src="js/phaser.js"></script> <div id="game"></div> <script> Window.PhaserGlobal ={ disableWebAudio: true }; var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.audio('boden','oedipus_wizball_highscore.mp3'); game.load.image('disk', 'wizball.png'); // Firefox doesn't support mp3 files, so use } var s; var music; function create() { game.stage.backgroundColor = '#182d3b'; game.input.touch.preventDefault = false; music = game.add.audio('boden'); music.play(); s = game.add.sprite(game.world.centerX, game.world.centerY, 'disk'); s.anchor.setTo(0.5, 0.5); game.input.onDown.add(changeVolume, this); } function changeVolume(pointer) { if (pointer.y < 100) { music.mute = false; } else if (pointer.y < 300) { music.volume += 0.1; } else { music.volume -= 0.1; } } function update() { s.rotation += 0.01; } function render() { game.debug.soundInfo(music, 20, 32); } </script> </body> </html> The html file and the audio file are in the exact same folder along with the image file and i don't know what is wrong Thanks Quote Link to post Share on other sites
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.