remove lastEnd

This commit is contained in:
Felix Roos
2022-04-01 16:15:58 +02:00
parent e6ae16ca51
commit 7faf1e1366
-3
View File
@@ -52,7 +52,6 @@ Loading...</textarea
worker;
audioContext;
startedAt = 0;
lastEnd;
interval = 0.2; // query span
constructor(audioContext, callback, interval = this.interval) {
this.audioContext = audioContext;
@@ -96,7 +95,6 @@ Loading...</textarea
const tick = Math.floor(sinceStart / this.interval); // tick number
const begin = round(tick * this.interval + this.startedAt, precision); // begin of tick
const end = round(begin + this.interval, precision); // end of tick
this.lastEnd = end;
// callback with query span, using clock #2 (the audio clock)
callback(begin, end);
}
@@ -104,7 +102,6 @@ Loading...</textarea
}
start() {
this.audioContext.resume();
delete this.lastEnd;
this.startedAt = this.audioContext.currentTime;
this.worker.postMessage('start');
}