The delay between playing a note and hearing it back through a computer comes from the buffers of the audio driver. The audio buffer latency calculator takes the buffer size, the sample rate, the number of output buffers and the overhead of the converters and gives the time for one buffer, the input latency, the output latency, the round-trip latency and the equivalent distance in air.
How the calculation works
- Time for one buffer = buffer size in samples ÷ sample rate × 1 000, in milliseconds.
- Input latency is one buffer, since the interface must fill a whole buffer before the computer sees the signal.
- Output latency is the number of output buffers times the buffer time. Two buffers is the usual setting.
- Round-trip latency = input + output + the fixed overhead of the converters and the driver. It is what a singer or a guitarist hears when monitoring through the computer.
- Distance = 343 m/s × the round trip. It shows how far you would have to stand from a speaker to hear the same delay.
Example
A buffer of 256 samples at 48 kHz lasts 256 ÷ 48 000 = 5.33 ms. With 2 output buffers the output adds 10.67 ms, and the converters add 1.5 ms. The round trip is 5.33 + 10.67 + 1.5 = 17.5 ms, the same delay as standing 6.0 m away from a speaker.
Why it matters
Latency decides whether a performer feels in time. A virtual instrument played from a keyboard, a vocal recorded with effects, or a guitar through an amplifier simulator all depend on a low round trip, and the buffer size is the main setting you control.
Good to know
The figures are the nominal ones given by the buffer size. Real drivers and operating systems add their own safety margins, and plugins that look ahead, such as limiters, add more. Wireless headphones add 100 ms or more, and no buffer setting can remove it. Measure the real round trip with a loopback cable when it matters.
Related tools
The beat delay calculator converts a tempo into delay times and the audio file size calculator estimates the storage used by a recording at a given sample rate.