AudioContext.currentTime
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
The currentTime
read-only property of the AudioContext
interface returns a double representing an ever-increasing hardware timestamp in seconds that can be used for scheduling audio playback, visualizing timelines, etc. It starts at 0.
Syntax
js
var audioCtx = new AudioContext();
console.log(audioCtx.currentTime);
Exemplo
js
var AudioContext = window.AudioContext || window.webkitAudioContext;
var audioCtx = new AudioContext();
// Older webkit/blink browsers require a prefix
...
console.log(audioCtx.currentTime);
Especificações
Specification |
---|
Web Audio API # dom-baseaudiocontext-currenttime |
Compatibilidade com navegadores
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
currentTime |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.