--- url: "https://web.dev/articles/audio-output-latency" titulek: "Synchronize audio and video playback on the web | Articles | web.dev" h1: "Synchronize audio and video playback on the web Stay organized with collections Save and categorize content based on your preferences." popis: "The Web Audio API makes it possible to properly achieve AV synchronization." jazyk: "en" kanonicka: "https://web.dev/articles/audio-output-latency" drobecky: ["Articles", "Synchronize audio and video playback on the web"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 22:28:16" znaku: 2354 slov: 292 kodovani: "iso-8859-2" sha256: "5fdfbca789acee8b4ad88d6ae56401a53faada31cd61b070b1633f0ac2fbe6bc" --- Synchronize audio and video playback on the web Stay organized with collections Save and categorize content based on your preferences. The Web Audio API makes it possible to properly achieve AV synchronization. François Beaufort The `outputLatency` property of an `AudioContext` instance provides an estimate of audio hardware's output latency (for example, that of Bluetooth earbuds or of an external USB audio interface). This property is useful when you want to: Synchronize the existing audio material and the newly recorded material. (in a music production scenario) Synchronize the [Web Audio](https://developer.mozilla.org/docs/Web/API/Web_Audio_API) output and other media (e.g. video or MIDI playback). In this [WebCodecs demo](https://wc-talk.netlify.app/simple_video_player.html) ([source](https://github.com/chcunningham/wc-talk)), the [WebCodecs API](https://developer.mozilla.org/docs/Web/API/WebCodecs_API) is used to decode a `MediaStream` into raw video and audio data, and then played back into a HTML `` element with audio data coming from an [Audio Worklet](https://developer.mozilla.org/docs/Web/API/AudioWorklet). The `outputLatency` property allows the demo to determine when a given audio timestamp is reaching the user's ears and then properly paint video frames to match that. The demo features an embedded video with audio controls for volume, audio buffer health, total output latency, and a checkbox to use `AudioContext.outputLatency`. Try it out for yourself, play the video with your favorite Bluetooth headset (🎧), wait for the bird (🐦) (see above), and toggle the checkbox (☑️) to observe audio playback changes. The total output latency value is updated in real time. AudioContext outputLatency Browser Support 102 102 70 18.4 [Source](https://developer.mozilla.org/docs/Web/API/AudioContext/outputLatency) Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For details, see the [Google Developers Site Policies](https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates. Last updated 2022-06-01 UTC.