Audio latency test

Measure the delay from your speakers to your microphone, and the delay you hear through Bluetooth headphones, beside what the browser reports.

Round trip: speaker to microphone

Unplug headphones and turn the volume up, so the microphone hears the speaker. Ten short chirps play at the level below, about 10 seconds in all.

Tap test: the delay you hear

Put on the headphones you want to test, volume low at first. Twenty clicks play at 100 BPM: count four, then tap along with the rest.

Nothing is uploaded. Everything runs in this tab with @audio/synth-chirp.

Two delays, measured two ways

Round-trip latency is the time from the moment a page sends a sound until the microphone brings it back: the output buffers, the converter, the speaker, the air, the microphone and the input buffers. A recording app has to shift each new take by this much to line it up with the backing track. Output delay is the part you hear, from the page to your ears. Bluetooth headphones add to it, and a microphone often cannot hear headphones, so the tap test measures it with your ears instead.

How the round trip is measured

The page plays ten chirps, each a 100 ms sweep from 500 Hz to 10 kHz made with @audio/synth-chirp, 0.81 to 0.97 s apart. One AudioContext records what it sends to the speaker and what the microphone hears side by side in an AudioWorklet, so both share one sample clock and no timer has to guess when a chirp left. For each chirp the recording is cross-correlated with the chirp through an FFT, and the lag of the highest peak is the delay.10 The page takes the envelope of the correlation, so the speaker's polarity does not move the peak, and a parabola through its top three points places it between samples. A result counts only when most chirps come back at the same delay, within 2 ms: noise lands anywhere, and the uneven spacing keeps a sound that repeats on its own from lining up with every chirp. The page reports the median of the chirps that agree, their spread, and the peak ratio: the peak over the next-highest one more than 1 ms away, usually an echo. Near 1×, an echo nearly as loud as the direct sound could have been taken for it. Delays up to 600 ms are searched.

Why the microphone's processing is off

Echo cancellation exists "to remove sound being played from the input signals recorded by the microphones",3 which is the very sound this test listens for. Noise suppression and automatic gain alter the signal too. So the page asks for echoCancellation, noiseSuppression and autoGainControl all false, reads the track's settings back, and says so if the browser kept any of them on. These switches cover the browser's own processing; a voice filter in the operating system or in a headset is outside them.

What the browser reports

AudioContext.baseLatency is the delay from the end of the audio graph into the system's audio stack; outputLatency runs from there to the output device.1 Chrome reports base latency since version 58 and output latency since 102, Firefox both since 70, Safari base latency since 14.1 and output latency since 18.4.2 Chrome 125 and later also report the microphone's input latency, in milliseconds, through the track's stats.2,4 The sum leaves out the air and whatever the operating system does not tell the browser; the measured round trip includes all of it.

The tap test, honestly

The page schedules twenty clicks at 100 BPM on the audio clock and times your taps (Space, or a touch on the pad) against the moment each click left the page. Nothing on screen moves with the beat, so you follow your ears. The result includes you: most people tap slightly ahead of a steady beat, the negative mean asynchrony,8 and a keyboard or touchscreen adds its own delay before the page sees the press. So the absolute number carries a personal offset. Run it once on wired headphones or the built-in speaker and once on Bluetooth: the difference between the two runs is the delay Bluetooth adds, and your own offset largely cancels.

Reading the numbers

Bluetooth headphones and the round trip

A computer's microphone hears closed headphones only when pressed against an ear cup at a high volume; the peak ratio tells you whether it did. Keep the computer's microphone selected, not the headset's: A2DP, the classic music link, has no return audio path,6 so a classic headset's microphone works over the hands-free profile (HFP), a separate voice link, and the round trip would measure that link instead of the one you listen through.

For the frequency response and reverberation time of your speakers and room, use the room and speaker measurement.

References

  1. MDN, AudioContext.baseLatency and AudioContext.outputLatency.
  2. MDN, browser-compat-data, api/AudioContext.json and api/MediaStreamTrackAudioStats.json (October 2026).
  3. W3C, Media Capture and Streams: the echoCancellation, noiseSuppression and autoGainControl constrainable properties.
  4. W3C, Media Capture and Streams Extensions: MediaStreamTrackAudioStats, input latency in milliseconds.
  5. Android, Android 16 Compatibility Definition, §5.6 Audio Latency: round-trip latency per device class.
  6. N. Hunn, Introducing Bluetooth LE Audio, 2nd ed. (2024), published by the Bluetooth SIG: §1, HFP and A2DP; §5.3, A2DP latency and delay reporting.
  7. ITU-R BT.1359-1 (1998), Relative timing of sound and vision for broadcasting: detectability about +45 to −125 ms, acceptability about +90 to −185 ms.
  8. B. H. Repp, “Sensorimotor synchronization: A review of the tapping literature,” Psychonomic Bulletin & Review 12 (2005): the negative mean asynchrony.
  9. R. Nave, HyperPhysics, Speed of sound: about 331.4 + 0.6·T m/s for air at T °C.
  10. C. H. Knapp & G. C. Carter, “The generalized correlation method for estimation of time delay,” IEEE Trans. Acoustics, Speech, and Signal Processing 24 (1976).

Questions

What is round-trip latency?

The time from the moment a page sends a sound until the microphone brings it back: the output buffers, the converter, the speaker, the air, the microphone and the input buffers. A recording app shifts each new take by this much to line it up with the backing track.

Why does the test say no loopback?

The microphone did not hear the chirps. Usually headphones are plugged in, so no sound reaches the room; or the volume is too low; or the browser is using a different microphone than you think. A processing step in the operating system or a headset that removes the speaker's sound has the same effect.

How do I measure my Bluetooth headphones' delay?

Run the tap test twice: once on wired headphones or the built-in speaker, once on the Bluetooth headphones. The difference between the two runs is what Bluetooth adds; your own timing cancels for the most part. For the round trip, hold the computer's microphone against an ear cup at a high volume, and keep the computer's microphone selected rather than the headset's.

Why are echo cancellation, noise suppression and auto gain turned off?

Echo cancellation exists to remove the sound being played from what the microphone records, which is exactly the signal this test listens for. Noise suppression and automatic gain change the signal as well. The page asks for all three off and reports back if the browser kept one on.

Why is the browser's figure different from the measured one?

The browser adds up only the buffers it knows about: AudioContext.baseLatency, outputLatency and, in Chrome 125 and later, the microphone's input latency. The measured round trip also holds the air (about 2.9 ms per metre) and any delay the operating system or the device does not report. Safari reports outputLatency only since version 18.4.

Is my microphone recorded or uploaded?

The recording lives in the tab's memory for the few seconds the analysis takes and is then dropped. Nothing is stored or sent.