How to calculate audio file size

How to calculate audio file size

with No Comments

This is how to calculate the size of an uncompressed (i.e., PCM) audio file:

(sampling rate * bit depth * duration in seconds * number of channels) / (8 bits per byte) = total number of bytes

For decimal:
/1,000 = kilobytes (kB)
/1,000,000 = megabytes (MB)
/1,000,000,000 = gigabytes (GB)

For binary:
/1,024 = kibibytes (KiB)
/1,048,576 = mebibytes (MiB)
/1,073,741,824 = gibibytes (GiB)

For example, the size of a 96kHz, 24-bit, hour-long, mono audio file is:

(96,000*24*3,600*1) / 8 = 1,036,800,000 bytes

1,036,800,000 / 1,000,000,000 = 1.0368 GB

As an interesting side note, file formats such as .wav and .aif have file size limits (i.e., 4 GB). Other formats, such as .caf, do not have the same limits. For example, I have used .caf to render a 96kHz, 24-bit, hour-long, 96-channel audio file without a problem (resulting in a file size of 99.5328 GB).

Leave a Reply