Calculate sound file size
The Sound File Size Formula
The size of an uncompressed digital audio file depends on three factors: how many samples are taken each second, how many bits store each sample, and how long the recording lasts. The AQA formula combines these three directly:
sampling rate (Hz)
sample resolution (bits)
duration in seconds
The result is the file size in bits. To convert to bytes, divide by 8. To convert further to kilobytes or megabytes, divide by 1,000 or 1,000,000 respectively (using AQA decimal prefixes). The formula applies to a single audio channel. For stereo recordings, which carry two independent channels (left and right), multiply the result by 2.
Understanding Why the Formula Works
Each second of audio produces exactly rate samples. Each sample stores exactly res bits. So in one second, rate × res bits are generated. Multiplying by the duration secs gives the total number of bits for the entire recording. The formula is simply a count of all bits produced - nothing more complex than that.
Worked Examples
Forward Calculation - Bits and Bytes
A voice memo is recorded at 8,000 Hz, 8-bit resolution, for 60 seconds.
- Bits per second: 8,000 × 8 = 64,000 bits/s
- Total bits: 64,000 × 60 = 3,840,000 bits
- Bytes: 3,840,000 ÷ 8 = 480,000 bytes
These settings (8 kHz / 8-bit) are typical for telephone-quality voice. The result is under 0.5 MB - compact enough to transmit quickly.
Converting to Larger Units
A music track is recorded at 44,100 Hz, 16-bit resolution, for 30 seconds.
- Total bits: 44,100 × 16 × 30 = 21,168,000 bits
- Bytes: 21,168,000 ÷ 8 = 2,646,000 bytes
- Kilobytes: 2,646,000 ÷ 1,000 = 2,646 kB
- Megabytes: 2,646,000 ÷ 1,000,000 = 2.646 MB
This is a mono recording. A stereo version at the same settings would be 5.292 MB - simply double, because there are two independent channels.
Reverse Calculation - Find Duration
A recording was made at 22,050 Hz, 8-bit resolution. The file is 5,292,000 bytes. How long is the recording?
- Convert bytes to bits: 5,292,000 × 8 = 42,336,000 bits
- Bits per second: 22,050 × 8 = 176,400 bits/s
- Duration: 42,336,000 ÷ 176,400 = 240 seconds (4 minutes)
Always convert bytes to bits before rearranging the formula. The three variables (rate, res, secs) multiply together, so to find any one of them, divide the total bits by the product of the other two.
Deep Dive: Stereo and Channels
The standard formula produces the file size for a single mono channel. A stereo recording captures two channels simultaneously - one for each speaker - which doubles the total data. Stereo audio files are therefore exactly twice the size of an equivalent mono recording at the same settings.
Some audio formats use even more channels: surround sound systems may use 5.1 (six channels) or 7.1 (eight channels). In each case, the file size is simply the single-channel result multiplied by the number of channels. At GCSE, AQA examines only the mono and stereo cases, so the multiplier is 1 or 2.
It is also worth noting that the formula gives the size of uncompressed audio data - the raw binary stream. Real-world audio files (MP3, AAC, FLAC) use compression to reduce this size significantly. An MP3 file may be ten times smaller than the raw data it represents. The formula ignores compression and calculates the theoretical maximum file size before any reduction is applied.
Key Takeaways
- Formula: File size (bits) = rate × res × secs, where rate is in Hz, res is in bits, and secs is duration in seconds.
- Divide by 8 to convert bits to bytes, then by 1,000 for kB, or 1,000,000 for MB.
- To reverse the formula, convert the file size to bits first, then divide by the product of the two known variables.
- For stereo audio, multiply the result by 2. For n channels, multiply by n.
- The formula gives the size of uncompressed audio. Compressed formats (e.g. MP3) produce smaller files but the formula cannot account for compression ratios.