v146 · Web APIs · Latency Stats

Latency Stats

The AudioContext exposes several latency measurements: baseLatency (rendering pipeline delay), outputLatency (hardware output delay), and getOutputTimestamp() (precise current playback time). Chrome 146 complements these with renderCapacity — together they give a complete picture of your audio pipeline's health.

Start audio to see live stats.

latency measurements

baseLatency
outputLatency
totalLatency (sum)

all stats at a glance

Property / Method Value Added What it measures
ctx.baseLatencyChrome 58Audio render pipeline latency (hardware buffer size)
ctx.outputLatencyChrome 83Hardware output buffer latency (driver/OS layer)
ctx.currentTimeAllAudioContext clock — monotonically increasing
ctx.getOutputTimestamp().contextTimeChrome 57AudioContext time of the last audio frame output
ctx.getOutputTimestamp().performanceTimeChrome 57wall-clock (performance.now) of the last audio frame
renderCapacity.averageLoadChrome 146Avg audio render thread CPU load (0–1)
renderCapacity.peakLoadChrome 146Peak audio render thread CPU load (0–1)
renderCapacity.underrunRatioChrome 146Fraction of dropped renders — non-zero = glitches (0–1)

controls

code

const ctx = new AudioContext();

// Static latency values (available immediately after construction)
console.log('baseLatency:', ctx.baseLatency, 's');       // e.g. 0.011
console.log('outputLatency:', ctx.outputLatency, 's');   // e.g. 0.046

// Precise timestamp of last audio frame output
const ts = ctx.getOutputTimestamp();
console.log('contextTime:', ts.contextTime);           // AudioContext seconds
console.log('performanceTime:', ts.performanceTime);   // ms since page load

// Chrome 146+ render capacity
ctx.renderCapacity.start({ updateInterval: 1.0 });
ctx.renderCapacity.addEventListener('update', e => {
  console.log('avg load:', e.averageLoad);
  console.log('peak load:', e.peakLoad);
  console.log('underruns:', e.underrunRatio);
});

see also