Firefox Tomorrow

web api instance property

AudioContext: playbackStats property

View on MDN ↗

Limited availability

The playbackStats read-only property of the AudioContext interface returns an AudioPlaybackStats object providing access to duration, underrun, and latency statistics for the AudioContext. These statistics allow you to measure audio delay and glitches.

It is possible to retrieve the immediate playout latency of the context via the outputLatency property; playbackStats, however, provides access to more detailed statistics that update over time, including average, minimum, and maximum latency.

Value

An AudioPlaybackStats object.

Examples

Basic usage

const audioCtx = new AudioContext();
const stats = audioCtx.playbackStats;

// ...

// Log average latency
console.log(stats.averageLatency);

See also the main AudioPlaybackStats reference page for a more in-depth example.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also