@phifans/audio
    Preparing search index...

    Class Clock

    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();

    Special thanks to bemuse.ninja for the code inspiration.

    Index

    Constructors

    Properties

    Constructors

    • Parameters

      • audioCtx: AudioContext
      • ticker: Ticker

      Returns Clock

    Properties

    currentTime: number = 0

    The current audio time.