--- title: AudioContext.currentTime slug: Web/API/BaseAudioContext/currentTime tags: - API - AudioContext - Propriedade - Referencia - Web Audio API - currentTime translation_of: Web/API/BaseAudioContext/currentTime original_slug: Web/API/AudioContext/currentTime ---
{{ APIRef("Web Audio API") }}
The currentTime
read-only property of the {{ domxref("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.
var audioCtx = new AudioContext(); console.log(audioCtx.currentTime);
var AudioContext = window.AudioContext || window.webkitAudioContext; var audioCtx = new AudioContext(); // Older webkit/blink browsers require a prefix ... console.log(audioCtx.currentTime);
Especificações: | Status | Comentario |
---|---|---|
{{SpecName('Web Audio API', '#widl-AudioContext-currentTime', 'currentTime')}} | {{Spec2('Web Audio API')}} |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatChrome(10.0)}}{{property_prefix("webkit")}} | {{CompatGeckoDesktop(25.0)}} | {{CompatNo}} | 15.0{{property_prefix("webkit")}} 22 (unprefixed) |
6.0{{property_prefix("webkit")}} |
Feature | Android | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | 26.0 | 1.2 | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | 33.0 |