Samples ⇄ Time Converter

Enter a number of samples and the sample rate to get the time. You can also turn a time into samples, or find the theoretical time of an audio buffer from its size.

What to calculate
samples
Time —
Details
Time (seconds)—
Time (milliseconds)—
Time (microseconds)—
As hours, minutes and seconds—
Time of one sample—
Values are shown with 7 significant digits (rounded); a value that does not divide evenly is labeled a rounded value.

Formulas

Everything is calculated with exact fractions, so no decimal rounding error creeps in. The only rounding is the one done when the result is displayed.

Time to samples

The number of samples is a whole number, but time × sample rate does not always come out as one. The calculator shows the exact value (which may have decimals) and two whole numbers: rounded down (the samples that fit completely in that time) and rounded up (the samples needed to cover that time). Which one you want depends on the use, so a "round to nearest" value is not given. When the result is exactly a whole number, the two are the same.

The time of a buffer is a theoretical time

Examples

Notes

Frequently asked questions

How many milliseconds is 480 samples at 48,000 Hz?

10 ms (480 ÷ 48,000 = 0.01 s).

How long is a 256-sample buffer?

About 5.333 ms at 48,000 Hz. This is the theoretical time; the delay of the whole system can be larger.

Is the buffer time all of the latency?

No. The buffer time is only part of the delay of a real system. A/D and D/A conversion, drivers, the operating system and plug-ins can add more.

Why is the number of samples not a whole number?

Because time × sample rate does not always come out as a whole number. The rounded-down and rounded-up whole numbers are shown too.