Skip to content

Commit f541437

Browse files
authored
Merge pull request #287 from JunShern/soundloop-pause-bugfix
Fix bug in pause, forgot to use currentTime to schedule pause
2 parents c676173 + 653195d commit f541437

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/soundLoop.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ define(function (require) {
117117
*/
118118
p5.SoundLoop.prototype.pause = function(timeFromNow) {
119119
var t = timeFromNow || 0;
120+
var now = p5sound.audiocontext.currentTime;
120121
if (this.isPlaying) {
121-
this.clock.pause(t);
122+
this.clock.pause(now + t);
122123
this.isPlaying = false;
123124
}
124125
};

0 commit comments

Comments
 (0)