removing computedOffset calculation when synced

fixes #721
This commit is contained in:
Yotam Mann 2020-09-23 22:11:38 -04:00
parent 530a997a07
commit d788183425
2 changed files with 2 additions and 7 deletions

View file

@ -580,7 +580,7 @@ describe("Player", () => {
// start halfway through
transport.start(0, 0.15);
}, 0.05).then((buff) => {
expect(buff.getValueAtTime(0)).to.be.closeTo(0.25, 0.03);
expect(buff.getValueAtTime(0)).to.be.closeTo(0.5, 0.05);
});
});

View file

@ -192,12 +192,7 @@ export class Player extends Source<PlayerOptions> {
}
// compute the values in seconds
let computedOffset = this.toSeconds(offset);
// if it's synced, it should factor in the playback rate for computing the offset
if (this._synced) {
computedOffset *= this._playbackRate;
}
const computedOffset = this.toSeconds(offset);
// compute the duration which is either the passed in duration of the buffer.duration - offset
const origDuration = duration;