Jump to content

error loading asset from UR


Recommended Posts

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(800600Phaser.CANVAS'phaser-example', { preload: preloadcreate: createupdate: updaterender: 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.centerXgame.world.centerY'disk');
    s.anchor.setTo(0.50.5);
 
    game.input.onDown.add(changeVolumethis);
 
}
 
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(music2032);
}
</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
 
Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...