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.
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 |
---|---|---|
Web Audio API The definition of 'baseLatency' in that specification. | Working Draft | Initial definition. |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 58 | ? | No | No | 45 | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 58 | 58 | ? | No | 45 | No | No |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/baseLatency