diff --git a/packages/core/examples/metro.html b/packages/core/examples/metro.html
index f9c97a00e..3d530dd51 100644
--- a/packages/core/examples/metro.html
+++ b/packages/core/examples/metro.html
@@ -53,6 +53,7 @@ Loading... {
if (e.data === 'tick') {
- const sinceStart = this.audioContext.currentTime - this.startedAt; // seconds since pressing start
- const tick = Math.floor(sinceStart / this.interval); // tick number
-
- const begin = round(tick * this.interval + this.startedAt, precision); // begin of tick
+ const begin = round(this.tick * this.interval, precision) + this.startedAt; // begin of tick
const end = round(begin + this.interval, precision); // end of tick
+ this.tick++;
// callback with query span, using clock #2 (the audio clock)
callback(begin, end);
}
};
}
start() {
+ console.log('start...');
this.audioContext.resume();
+ this.tick = 0;
this.startedAt = this.audioContext.currentTime;
this.worker.postMessage('start');
}
stop() {
+ console.log('stop...');
this.worker.postMessage('stop');
}
}