--- title: AudioContext.baseLatency slug: Web/API/AudioContext/baseLatency translation_of: Web/API/AudioContext/baseLatency ---

{{SeeCompatTable}}{{APIRef("Web Audio API")}}

The baseLatency read-only property of the {{domxref("AudioContext")}} interface returns a double that represents the number of seconds of processing latency incurred by the AudioContext passing the audio from the {{domxref("AudioDestinationNode")}} to the audio subsystem.

You can request a certain latency during {{domxref("AudioContext.AudioContext()", "construction time", "", "true")}} with the latencyHint option but the browser may ignore the option.

Syntax

var baseLatency = audioCtx.baseLatency;

Value

A double representing the base latency in seconds.

Example

//default latency ("interactive")
const audioCtx1 = new AudioContext();
console.log(audioCtx1.baseLatency);//0.01

//higher latency ("playback")
const audioCtx2 = new AudioContext({ latencyHint: 'playback' });
console.log(audioCtx2.baseLatency);//0.02

Specifications

Specification Status Comment
{{SpecName('Web Audio API','#dom-audiocontext-baselatency','baseLatency')}} {{Spec2('Web Audio API')}} Initial definition.

Browser Compatibility

{{Compat("api.AudioContext.baseLatency")}}