| title | AudioPlaybackStats: resetLatency() method | |
|---|---|---|
| short-title | resetLatency() | |
| slug | Web/API/AudioPlaybackStats/resetLatency | |
| page-type | web-api-instance-method | |
| status |
|
|
| browser-compat | api.AudioPlaybackStats.resetLatency |
{{APIRef("Web Audio API")}}{{SeeCompatTable}}
The resetLatency() method of the {{domxref("AudioPlaybackStats")}} interface resets the start of the interval during which latency statistics are measured to the {{domxref("BaseAudioContext.currentTime")}}.
resetLatency()
None.
None ({{jsxref("undefined")}}).
const audioCtx = new AudioContext();
const stats = audioCtx.playbackStats;
// ...
// Reset the latency measurement to the current time
stats.resetLatency();See also the main {{domxref("AudioPlaybackStats")}} reference page for a more in-depth example.
{{Specifications}}
{{Compat}}