How to calculate audio file size?

Osama Al-far picture Osama Al-far · Nov 25, 2012 · Viewed 68k times · Source

You have 30 seconds audio file sampled at a rate of 44.1 KHz and quantized using 8 bits ; calculate the bit rate and the size of mono and stereo versions of this file ؟؟

Answer

Mark Heath picture Mark Heath · Nov 26, 2012

The bitrate is the number of bits per second.

bitrate = bitsPerSample * samplesPerSecond * channels

So in this case for stereo the bitrate is 8 * 44100 * 2 = 705,600kbps

To get the file size, multiply the bitrate by the duration (in seconds), and divide by 8 (to get from bits to bytes):

fileSize = (bitsPerSample * samplesPerSecond * channels * duration) / 8;

So in this case 30 seconds of stereo will take up (8 * 44100 * 2 * 30) / 8 = 2,646,000 bytes