This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The baseLatency
read-only property of the AudioContext
interface returns a double that represents the number of seconds of processing latency incurred by the AudioContext
passing the audio from the AudioDestinationNode
to the audio subsystem.
You can request a certain latency during construction time 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 |
---|---|---|
Web Audio API The definition of 'baseLatency' in that specification. |
Working Draft | Initial definition. |
Browser Compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 60 | ? | No | No | 47 | No |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic support | 60 | 60 | ? | No | No | 47 | No |