AudioPlaybackStats: resetLatency() method

The resetLatency() method of the AudioPlaybackStats interface resets the start of the interval during which latency statistics are measured to the BaseAudioContext.currentTime.

Syntax

js
resetLatency()

Parameters

None.

Return value

None (undefined).

Examples

Basic usage

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

// ...

// Reset the latency measurement to the current time
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