Audio duration & size

Audio sample length and PCM size calculator

Calculate an audio loop's duration, sample frames and packed PCM payload from bars, BPM, meter, sample rate, bit depth and channels.

Sample length: settings and guide

Loop duration0:08.0008 seconds · 4/4
Sample frames384,000
Exact payload bytes2,304,000
Decimal payload size2.304 MB
Binary size2.197 MiB

Sample frames are rounded exactly to the nearest whole frame. Size is the packed PCM audio payload using the stored bit depth; headers, metadata and container padding are excluded.

Formula

How to calculate sample length and PCM size

First convert the selected meter and bar count into an exact musical duration at quarter-note BPM. Multiply by sample rate and round the resulting rational value to the nearest whole sample frame. For packed PCM payload size, multiply frames by channel count and stored bytes per sample.

sample frames = exact duration × sample rate, rounded to the nearest whole frame

  1. 01

    A sample frame contains one simultaneous sample position for every channel; the frame count determines duration.

  2. 02

    The payload estimate assumes the selected stored bit depth. Choose 32 bit when 24 valid bits are stored in a 32-bit container.

  3. 03

    Compressed formats such as MP3, AAC and FLAC will have different file sizes.

Worked example

Example: a four-bar 48 kHz stereo loop

Four bars of 4/4 at 120 quarter-note BPM last 8 seconds. At 48 kHz that is 384,000 sample frames. At packed 24-bit stereo, the audio payload is 2,304,000 bytes, or about 2.20 MiB, before headers or metadata.

Good to know

Assumptions and limits

  • Tempo is constant and entered as quarter-note BPM; the complete time signature determines the bar length.
  • Sample frames are rounded exactly to the nearest whole frame, with half-frame ties rounded upward.
  • File size describes packed PCM audio payload using the stored bit depth and excludes headers, metadata, container padding and compression.

Review BeatTiming's calculation accuracy, precision and release-testing methodology.

Loop frame reference

Common loop lengths in sample frames

Sample-frame count depends on musical duration and sample rate, not channel count. The reference below uses 4/4 at 120 BPM; stereo changes the number of stored sample values and bytes, but not the frame count or duration.

4/4 loops at 120 BPM

Duration and sample frames for common loop lengths at 120 BPM and 44.1 or 48 kHz
LengthDuration44.1 kHz frames48 kHz frames
1 bar0:02.00088,20096,000
4 bars0:08.000352,800384,000
8 bars0:16.000705,600768,000
16 bars0:32.0001,411,2001,536,000
Quick answers

Frequently asked questions

How many sample frames are in one second?

At 44.1 kHz there are 44,100 sample frames per second; at 48 kHz there are 48,000. Each frame contains one value per channel.

Why is a stereo file twice as large?

Stereo stores two sample values in every frame—one for the left channel and one for the right.

Does bit depth change duration?

No. Bit depth changes the data stored for each sample and therefore file size, not playback duration.