Jump to content

Audiosprite plays all sounds in one go when it should only play one sound as per the markers


Recommended Posts


The audiosprite code in this game is a complete clone of a game I worked on previously and that didn't have this issue. I have been through every line of that as well as this, and everything matches, even the version of phaser (2.3, I am not using 2.4 for other reasons), but this one has the audiosprite issue where instead of one sound playing, all the following sounds follow as well. Try player the game at ice.site44.com , try collecting the gold chest and you will notice after gold sound, other sounds play as well. 


Code is tiny and simple. Please check code at ice.site44.com in dev tools too. Its small.

this.load.audio("sfx", ["assets/audio/output.ogg", "assets/audio/output.m4a"]);
this.sound = this.add.audio('sfx');this.sound.allowMultiple = true;// defining the markers// key, the time the sound starts and the duration - in seconds.this.sound.addMarker('fireworks', 0, 6);this.sound.addMarker('single_nugget', 7, 8);this.sound.addMarker('Game_Start', 9, 12);this.sound.addMarker('Fail_02B', 13, 16);this.sound.addMarker('explosion_5', 18, 19);


    checkOverlapGold: function(body1, body2) {            this.sound.play('single_nugget');        }
Link to comment
Share on other sites


  • Recently Browsing   0 members

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