Jump to content

Audio loop duplicating - Bug?


Zampano
 Share

Recommended Posts

Hi there,

I've stumbled across some very weird audio behavior and can't seem to avoid it. 

I'm trying to loop a marker of my audio file, which works well on itself. Whenever pausing and resuming the audio loop at least once however, as soon as the next loop point is reached it will not stop the currently running audio and play from the marker but just add a new layer of audio that plays from the marker instead, while the old one just continues to play. And it keeps doing that for every loop.

//Create
{
this.sfx_music = this.sound.add("key);
this.sfx_music.allowMultiple = false;
this.sfx_music.addMarker('turbo', 116.8696, 7.3846, 1, true);
this.sfx_music.play('turbo');
}

unpauseGame: function() {
	if(this.game.paused)
	{
		this.game.paused = false;
		this.sfx_music.resume();
	}
},

pauseGame: function() {
	this.sfx_music.pause();
	this.game.paused = true; 
}

Pausing the game without pausing the music doesn't cause this problem, but It's mandatory for me to pause the music when pausing the game..

Could this be a bug in sound.pause() or sound.resume()?
I'm using Chrome but I have the same behavior in firefox as well.

Please help!
Best

Zampano

Link to comment
Share on other sites

  • 2 weeks later...
 Share

  • Recently Browsing   0 members

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