Calculate audio latency from buffer size and sample rate, solve missing audio settings, or estimate sound delay by distance and medium.
Calculator Functions
| Function | What it does | What it requires |
|---|---|---|
| One-buffer latency | Finds the delay that one audio buffer represents, in milliseconds | Requires the buffer size in samples per channel and the sample rate, which starts at 48 kHz |
| Buffer size from delay | Finds the number of samples that fills a given delay | Requires the one-buffer delay in ms or s and the sample rate |
| Sample rate from delay | Finds the sample rate at which a buffer lasts a given delay | Requires the buffer size in samples per channel and the one-buffer delay |
| Sound travel delay | Finds the time sound takes to travel a distance one way, for aligning delay speakers or microphones | Requires the travel distance in m or ft and the medium: air at 20 °C, air at 0 °C, fresh water or steel |
The sample rate field accepts Hz or kHz and suggests 44.1, 48, 96 and 192 kHz. The three buffer functions also show how far sound travels through 20 °C air in the same time, which puts a buffer delay in physical terms: 10 ms is about 3.4 m.
Audio Latency Formulas
| L | Delay of one buffer (ms) |
| N | Buffer size (samples per channel) |
| fs | Sample rate (Hz, samples per second) |
A buffer of N samples played at fs samples per second lasts N ÷ fs seconds. Multiplying by 1,000 gives milliseconds.
One-buffer latency
The main formula applies directly. A 256-sample buffer at 48,000 Hz lasts 256 ÷ 48,000 × 1,000 = 5.33 ms, and the same buffer at 96,000 Hz lasts half as long.
| Buffer size | At 44.1 kHz | At 48 kHz | At 96 kHz |
|---|---|---|---|
| 32 | 0.73 ms | 0.67 ms | 0.33 ms |
| 64 | 1.45 ms | 1.33 ms | 0.67 ms |
| 128 | 2.90 ms | 2.67 ms | 1.33 ms |
| 256 | 5.80 ms | 5.33 ms | 2.67 ms |
| 512 | 11.61 ms | 10.67 ms | 5.33 ms |
| 1024 | 23.22 ms | 21.33 ms | 10.67 ms |
| 2048 | 46.44 ms | 42.67 ms | 21.33 ms |
Buffer size from delay
A 10 ms delay at 48,000 Hz is 480 samples. The answer can be fractional or fall between the sizes a device offers, so it is a target to round to a supported setting.
Sample rate from delay
A 441-sample buffer that lasts 10 ms implies a sample rate of 44,100 Hz.
Sound travel delay
t is the one-way travel time in ms, d is the distance in meters and v is the speed of sound in m/s. The air options use 343 m/s at 20 °C and 331 m/s at 0 °C, which match the temperature formula for air [1]. Fresh water uses 1,480 m/s and steel uses 5,960 m/s for a longitudinal wave. A delay speaker 34.3 m from the main speakers in 20 °C air needs 34.3 ÷ 343 × 1,000 = 100 ms. Distances in feet are converted at 0.3048 m per foot.
Limits of This Estimate
- One-buffer latency is not round-trip latency. The delay from input to output also includes the input and output buffers, the converters, the driver and any plugins, so the measured figure is always larger.
- A delay that suits one task can be too long for another. The result is a duration, not a rating of whether monitoring or live playing will feel responsive.
- The speed of sound in air depends on temperature [1]. The water and steel figures are round reference values that shift with temperature, composition and wave type. These estimates are based on the best available data and estimations.
Sources
- U.S. National Weather Service, Speed of Sound: speed of sound in air as a function of air temperature
