An audio clock is a replacement of AudioContext.currentTime.
You don't need to manually create the audio clock usually; instead you can get the global audio clock via Bus#clock.
You can get the current audio time by Clock#currentTime:
const clock = bus.clock;function update() { console.log('Current audio time:', clock.currentTime); requestAnimationFrame(update);};update(); Copy
const clock = bus.clock;function update() { console.log('Current audio time:', clock.currentTime); requestAnimationFrame(update);};update();
Special thanks to bemuse.ninja for the code inspiration.
The original code
The current audio time.
An audio clock is a replacement of AudioContext.currentTime.
You don't need to manually create the audio clock usually; instead you can get the global audio clock via Bus#clock.
You can get the current audio time by Clock#currentTime:
Special thanks to bemuse.ninja for the code inspiration.
See
The original code