Audio duration & size

Sample length calculator

Calculate loop duration, samples per channel and uncompressed PCM file size from musical length.

Loop duration0:08.0008.000000 seconds
Samples / channel384,000
Total sample values768,000
PCM size2.304 MB
Binary size2.197 MiB
Formula

How to calculate sample length and PCM size

First convert the musical length into seconds. Multiplying seconds by sample rate gives the samples in each channel. For uncompressed PCM size, multiply by channel count and bytes per sample.

samples per channel = duration in seconds × sample rate

  1. 01

    Sample count is per channel; stereo files contain two channels of samples.

  2. 02

    The file-size estimate is for uncompressed PCM audio and excludes small container headers.

  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 BPM last 8 seconds. At 48 kHz that is 384,000 samples per channel. At 24-bit stereo, the audio data is 2,304,000 bytes, or about 2.20 MiB, before the small file header.

Good to know

Assumptions and limits

  • The tempo stays constant and the BPM counts the selected beats per bar.
  • Sample count is rounded to the nearest whole sample when a duration falls between samples.
  • File size describes uncompressed PCM data and excludes headers, metadata and compression.
Quick answers

Frequently asked questions

How many samples are in one second?

At 44.1 kHz there are 44,100 samples per channel per second; at 48 kHz there are 48,000.

Why is a stereo file twice as large?

Stereo stores separate sample streams for the left and right channels.

Does bit depth change duration?

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