AudioPlaybackStats: averageLatency property
The averageLatency read-only property of the AudioPlaybackStats interface is a number indicating the average latency since the audio context was first initialized, or since AudioPlaybackStats.resetLatency() was last called.
Value
A double-precision floating point number indicating the average latency, in seconds.
Examples
>Basic usage
js
const audioCtx = new AudioContext();
const stats = audioCtx.playbackStats;
// ...
// Log current average latency
console.log(stats.averageLatency);
See also the main AudioPlaybackStats reference page for a more in-depth example.
Specifications
| Specification |
|---|
| Web Audio API> # dom-audioplaybackstats-averagelatency> |