Block time and timestamp span answer different questions
At a uniform rate Fs, each frame position is one period, 1/Fs, after the preceding position. An N-frame block occupies N/Fs seconds. Its timestamps run from index zero through index N minus 1, so their first-to-last span is (N−1)/Fs. A block endpoint is one period after the final timestamp.
A frame contains the simultaneous channel values at one position. Stereo does not double this duration. “Samples” here means frames or samples per channel, not the combined number of channel values.
Worked example: 480 frames at 48 kHz
This block occupies 480/48000 second, exactly 10 milliseconds. Its first-to-last timestamp span is 479/48000 second, or 479/48 milliseconds, about 9.97916666667 milliseconds. One frame occupies one period but its first-to-last timestamp span is zero. An empty block has no timestamps.
When a target falls between whole counts
For a 1 millisecond target at 44.1 kHz, occupied-block equivalence is 44.1 frames. A physical whole count is either 44, achieving 440/441 millisecond and falling short by 1/441 millisecond, or 45, achieving 50/49 millisecond and exceeding the target by 1/49 millisecond. For a first-to-last span the corresponding whole counts are 45 and 46. The calculator reports both rather than choosing which timing error fits your task.
Finding a rate
Divide the number of intervals by the supplied duration. A 1001-frame occupied block lasting one second implies 1001 Hz; a first-to-last span of one second implies 1000 Hz. Zero intervals and zero duration fit every positive rate and do not identify a rate. Positive intervals over zero time, or zero intervals over positive time, have no finite positive solution.
Exact source and display units
Rate and time are evaluated as exact fractions from the entered source and its unit. Changing an input unit deliberately reinterprets the entered digits and requires Calculate again. The separate Show controls only change the view of an existing result. Rounded displays never become calculation inputs. “About” marks a rounded number; exact fractions remain available in the result details.
Scope and sources
This is nominal constant-rate arithmetic, not an audio measurement or total latency prediction. One buffer's duration does not include converters, hidden buffers, processing, device clocks or acoustic travel. The tool does not upload or process audio files.
The W3C Web Audio API Recommendation of June 17, 2021 defines buffer length in sample frames, separates channel count and computes duration as length divided by sample rate. Its playback algorithm uses a one-over-rate time increment. The first-to-last formula above follows from the stated uniform timestamps; it does not certify equipment clock accuracy. This calculator's input limits are its own bounded arithmetic policy, not the API's constructor limits.
Privacy and sharing
Calculation stays in this page without project storage or automatic input transmission. Copy and print keep the current complete result or explanation. A public link is created only with consent and includes all numeric source values, units and reference. Anyone with that link can see them. Explanatory or outside-domain outcomes have no numeric public preview.