Samples to Milliseconds Calculator
Convert sample frames into the duration of one audio buffer, or enter milliseconds to find a frame count. Use the sample rate from your project or audio interface.
Buffer duration
256 frames × 1,000 ÷ 48000 Hz
Buffer duration by sample rate
| Sample rate (Hz) | Buffer (frames) | Duration (ms) |
|---|---|---|
| 44,100 | 256 | 5.804989 |
| 44,100 | 882 | 20 |
| 48,000 | 128 | 2.666667 |
| 48,000 | 256 | 5.333333 |
| 48,000 | 512 | 10.666667 |
| 96,000 | 256 | 2.666667 |
What counts as one frame?
One sample frame holds one sample from each channel at the same instant. A stereo buffer containing 512 interleaved sample values holds 256 frames. Enter 256 for that buffer.
At 48 kHz, 48,000 frames pass in one second. Divide 256 by 48,000 and multiply by 1,000 to get 5.333333 ms. In the other direction, 20 ms × 44,100 Hz ÷ 1,000 gives exactly 882 frames.
The W3C Web Audio API defines buffer length in sample frames and duration in seconds. The calculator converts that duration to milliseconds.
W3C AudioBuffer definitionsHow to convert a buffer setting
- Choose Frames → ms or ms → Frames to match the value you have.
- Enter the value and select the project’s sample rate. For a custom rate, enter hertz (48 kHz = 48,000 Hz).
- Read the buffer duration or nearest whole frame. To repeat either worked example, choose its direction and press Load Sample.
A driver can queue several buffers. A microphone loopback measurement also includes playback, sound travel and capture. Use the measured path when you need your device’s round-trip delay.
04 / TECHNICAL Q&A
Frequently Asked Questions
Do I enter samples or sample frames?
Use the frame count. If an audio buffer reports its length per channel, use that number directly. If you counted individual interleaved sample values, divide by the number of channels first.
Why does a 256-frame buffer get shorter at 96 kHz?
At 96 kHz, the device processes twice as many frames per second as at 48 kHz. The same 256 frames take 2.666667 ms at 96 kHz and 5.333333 ms at 48 kHz.
How are fractional frame counts rounded?
The main result uses the nearest whole frame. Half a frame rounds up. At 44,100 Hz, 1 ms gives 44.1 frames, so the nearest buffer is 44 frames. Displayed durations and fractional counts use up to six decimal places.
Which sample rate should I use after resampling?
Use the rate of the buffer whose frames you counted. For a 44.1 kHz file played in a 48 kHz session, use 44.1 kHz for source-file frames and 48 kHz for frames in the resampled session buffer.
Will this predict the delay I hear in my headphones?
One buffer contributes only part of the delay. Driver queues, wireless encoding, converters and input capture can each add time. Measure the actual playback or loopback path to check the combined delay.