Skip to content

Commit

Permalink
soundfile: patch addCue bug (#405)
Browse files Browse the repository at this point in the history
- the first cue would not fire because `_prevUpdateTime` was undefined
- possible fix for #371 addCue not triggering function calls
  • Loading branch information
therewasaguy authored Jan 6, 2020
1 parent 459616e commit b27d7a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/soundfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1662,15 +1662,15 @@ define(function (require) {
var callbackTime = cue.time;
var val = cue.val;

if (this._prevTime < callbackTime && callbackTime <= playbackTime) {
if (~~this._prevUpdateTime <= callbackTime && callbackTime <= playbackTime) {

// pass the scheduled callbackTime as parameter to the callback
cue.callback(val);
}

}

this._prevTime = playbackTime;
this._prevUpdateTime = playbackTime;
};

/**
Expand Down

0 comments on commit b27d7a8

Please sign in to comment.