AudioPlaybackStats: resetLatency() method

The resetLatency() method of the AudioPlaybackStats interface sets the interval over which the latency stats are measured to the BaseAudioContext.currentTime onwards.

Syntax

js
resetLatency()

Parameters

None.

Return value

None (undefined).

Examples

Basic usage

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

// ...

// Reset latency measurements to current time onwards
stats.resetLatency();

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

Specifications

Specification
Web Audio API
# dom-audioplaybackstats-resetlatency

Browser compatibility

See also