Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate audio file size?

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 ؟؟

like image 834
Osama Al-far Avatar asked Nov 25 '12 22:11

Osama Al-far


People also ask

How many MB is 1 minute of audio?

Megabyte or MB The rule of thumb for MP3 audio is that 1 minute of audio takes up about 1 megabyte. Audio and image and video data typically stored in "compressed" form, MP3 being an example. We'll talk about how compression works later.

How many MB is 1 hour audio?

So for stereo, about 1.3 GB per hour, or 0.65 GB (635 MB) for 1 hour mono. You would normally export (to create a normal audio file) in a less extreme format. For lossy (inexact) compressed formats such as MP3, OGG, AAC, WMA and the rest, the file size depends on the quality settings.

How big is a 60 minute audio file?

MP3, 2 tracks, 192 kb/s A good rule of thumb to remember is that 60 minutes of 2 track 24-bit 48 kHz BWAV audio requires about 1 GB of storage.


1 Answers

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

like image 61
Mark Heath Avatar answered Oct 11 '22 12:10

Mark Heath