--- 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.
var baseLatency = audioCtx.baseLatency;
A double representing the base latency in seconds.
//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
Specification | Status | Comment |
---|---|---|
{{SpecName('Web Audio API','#dom-audiocontext-baselatency','baseLatency')}} | {{Spec2('Web Audio API')}} | Initial definition. |
{{Compat("api.AudioContext.baseLatency")}}