If you paused a Sound object that is using audio markers and then resumed it, it wouldn't correctly calculate the resume duration - causing the sound to sometimes play into the marker that followed it (thanks @AnderbergE #1669)

This commit is contained in:
photonstorm 2015-03-24 14:43:24 +00:00
parent 483bb240a6
commit 96e313e768
2 changed files with 5 additions and 2 deletions

View file

@ -224,6 +224,7 @@ We've rolled our own fixes into our version of Pixi, ensuring we keep it as bug-
* Animations are now guarded allowing Sprites with animations to be destroyed from within onUpdate, onLoop or onComplete events (thanks @pnstickne #1685 #1679)
* Text.lineSpacing can now accept negative values without cutting the bottom of the Text object off. The value can never be less than the height of a single line of text (thanks @anthonysapp #1690)
* Text.lineSpacing is no longer applied to the first line of Text, which prevents text from being cut off further down the Text object.
* If you paused a Sound object that is using audio markers and then resumed it, it wouldn't correctly calculate the resume duration - causing the sound to sometimes play into the marker that followed it (thanks @AnderbergE #1669)
### Pixi 2.2.8 Bug Fixes

View file

@ -794,14 +794,16 @@ Phaser.Sound.prototype = {
this._sound.onended = this.onEndedHandler.bind(this);
}
var duration = this.duration - (this.pausedPosition / 1000);
if (typeof this._sound.start === 'undefined')
{
this._sound.noteGrainOn(0, p, this.duration);
this._sound.noteGrainOn(0, p, duration);
//this._sound.noteOn(0); // the zero is vitally important, crashes iOS6 without it
}
else
{
this._sound.start(0, p, this.duration);
this._sound.start(0, p, duration);
}
}
else