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 GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
currentTime

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Veja também