Skip to content
12notez

Audio Latency Explained: Buffer and Sample Rate

Turn a buffer size and sample rate into milliseconds, see what a round trip adds up to, and learn what to check when you hear a delay.

·By Sudeep Jain

Latency is the time between a sound going in and the same sound coming back out. The part you set yourself is the buffer: divide the buffer size in samples by the sample rate and you have the time one buffer lasts. A 128-sample buffer at 48 kHz lasts 2.67 ms, and the Audio Latency Calculator does that division for any size and rate.

That 2.67 ms is only one piece. This guide follows one setup, 128 samples at 48 kHz, from the buffer to the full round trip, and shows what each piece is made of.

Why recording makes you notice it

When you record, your voice or instrument goes into the interface and is turned into numbers. Your computer processes those numbers in chunks and sends them back out to your headphones. Each chunk has to fill before it moves on, and that wait is the delay.

If you listen through the computer, you hear yourself a little late. Ardour's manual says a singer who hears their own voice through two paths, through the bones of the head and through headphones, can find even small delays disturbing. The tool shows the delay as a number so you can stop guessing at it. For the room and microphone side of a home recording, see how to record a clean voice at home.

From buffer size to milliseconds

The formula is the definition of a sample rate. A rate of 48 kHz means 48,000 samples every second, so one sample lasts about 0.02 ms and 1 ms holds 48 samples.

Type 128 into Buffer size, pick 48 in the Sample rate (kHz) row, and the readout shows 128 divided by 48,000 Hz, which is 2.6667 ms. Round it to 2.67.

The same buffer at other rates, using the tool's math:

  • 44.1 kHz gives 2.90 ms.
  • 96 kHz gives 1.33 ms.

So at a fixed buffer size, a higher sample rate shortens the wait, because each buffer holds less time. A buffer of 256 at 48 kHz lasts 5.33 ms, twice as long as 128, and the delay doubles each time you step up the presets (16, 32, 64, 128 and on to 4096).

What a round trip means

One buffer is the time on the way in or the way out. The Ardour manual defines round-trip latency as "the time necessary for a certain audio event to be captured, processed and played back." You hear both directions, so the figures add.

The calculator's Buffer-only round trip counts one input buffer and one output buffer. For our example that is 2 x 2.67, or 5.33 ms. It is exactly twice one buffer and nothing more.

What the buffer-only figure leaves out

The buffer size does not tell you everything the signal goes through. The Ardour manual lists converting between analog and digital, and for USB or FireWire interfaces "the bus clocking and buffering" that "can add some milliseconds." It also says that latency "is always additive and a sum of many independent factors." The same page puts conversion delay at usually below 1 ms.

The calculator does not guess those parts, because the buffer size cannot reveal them. Only your own system can. Many DAWs report an input and an output latency in their audio settings. Open the Audio Latency Calculator and type those into Input latency your DAW reports and Output latency your DAW reports. Each field takes milliseconds or samples.

Say your DAW reports 3.2 ms in and 2.9 ms out for the 128-sample setup. Your DAW's round trip reads 6.1 ms, and Beyond the two buffers reads +0.77 ms, which is 36.8 samples at 48 kHz. That small remainder is everything the buffers did not explain.

If the two figures add up to less than the buffers, the tool says so and asks you to check that they were read at the same buffer size and rate. A mismatch there is the usual reason.

Plugin delay

Some plugins hold audio back so they can analyze it, and each one reports how long. On one track, plugins in a row add up. The Plugin delay sum block takes each plugin's reported latency in samples or milliseconds and totals them.

For example, a 64-sample plugin followed by a 32-sample plugin is 96 samples, or 2 ms at 48 kHz. The buffer-only round trip does not include that. If a track sounds late only when certain plugins are on, this is where to look.

Direct monitoring

The way around the delay is to stop listening through the computer. Many interfaces can mix the input straight to the headphone output inside the box, so you hear yourself before the signal ever reaches the buffers. Your DAW still records through the buffers, but what you hear does not.

In our audio interface catalog, 85 of the 267 interfaces list direct monitoring as a feature. Check the spec sheet for how it is switched on. Our audio interface specs guide covers the other figures on that sheet. The catch is that you no longer hear plugin effects on the monitor mix, such as reverb added in the DAW. For a guitarist that includes the amp simulator, which how to record guitar at home works around.

How it compares with sound in air

Sound in air travels about 343 m/s at room temperature, so each millisecond is about 34 cm. The calculator's Distance in air card does the arithmetic with an Air temperature field.

For the example, one 2.67 ms buffer equals 0.91 m of air. The buffer-only round trip, 5.33 ms, is 1.83 m. The 6.1 ms your DAW reported is 2.09 m. Imagine standing that far from your own speaker while you play.

Settings checks and common mistakes

  • Read both figures at the same settings. If you change the buffer or the rate, the DAW's reported latency changes too. Take the numbers again.
  • Put the sample rate in kHz. The tool reads 48 as 48 kHz, and any figure of 1000 or more as Hz.
  • Do not raise the sample rate hoping to fix everything. It shortens each buffer, but the tool's math covers only the buffers, so compare the totals your DAW reports.
  • A small buffer is not free. Ardour's manual says smaller chunks mean the computer must finish its work more often, and when it misses the deadline you get clicks, pops and crackles. If you hear them, step the buffer up one preset.
  • Check the unit. Each latency field has its own ms and samples pill, and 64 typed as samples is not 64 ms.
  • If a recorded track lands late, measure the offset in your DAW and use Recorded offset. Choose Lands late, type the offset, and the tool says how far to move it earlier. A 300-sample offset at 48 kHz is 6.25 ms.

Sources

More guides