Calculating the size of a sound file

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Calculating the size of a sound file

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which formula gives the size of an uncompressed sound file in bits?
A sample rate x sample resolution x length in seconds
B sample rate + sample resolution + length in seconds
2. A sound has a sample rate of 100 Hz, a sample resolution of 8 bits and lasts 10 seconds. What is the file size in bits?
A 8000 bits
B 800 bits
3. You have worked out a sound file is 8000 bits. How do you convert this to bytes?
A Multiply by 8
B Divide by 8
4. A sound is 1 minute long. What length do you use in the file size formula?
A 60 seconds
B 1 second
5. A sound has a sample rate of 1000 Hz, a sample resolution of 16 bits and a length of 5 seconds. What is its size in bits?
A 8000 bits
B 80000 bits

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1size_bits = rate * resolution * seconds ACalculates the uncompressed sound file size in bits
2size_bytes = size_bits / 8 B8000 * 8 * 5 / 8
3Worked example: a 10 second sound sampled at 44100 Hz with 16-bit resolution has this size in bits CConverts the file size from bits to bytes
4Size in bytes of a 5 second sound at 8000 Hz and 8-bit resolution: multiply to get bits, then divide by 8 D44100 * 16 * 10
5size_bits = rate + resolution + seconds EThe result is multiplied by 8 instead of divided by 8. Bits must be divided by 8 to get bytes.
6size_bytes = rate * resolution * seconds * 8 FThe three values are added instead of multiplied. The size in bits is rate x resolution x seconds.

Definitions

size = sample rate x resolution x seconds

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
bits = rate * __________ * seconds
2.
bits = rate * resolution _ seconds
3.
bytes = bits _ 8
4.
bytes = bits / _
5.
seconds = 2 * __ bits = 8000 * 8 * seconds

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A rate = 8000
B res = 16
C bits = rate * res
D print(bits)
Question 2
A bits = 8000 * 16 * 10
B bytes = bits / 8
C print(bits)
Question 3
A rate = 22050
B res = 8
C secs = 60
D bits = rate * res + secs
Question 4
A bits = 8000 * 30
B bytes = bits / 8
C kib = bytes / 1024
D print(kib)
Question 5
A bits = 16000 * 8 * 20
B bytes = bits / 8
C kib = bytes / 1000
D print(kib)

Answer Key

Calculating the size of a sound file
Section A: Quick Questions
Q1
A — sample rate x sample resolution x length in seconds
Q2
A — 8000 bits
Q3
B — Divide by 8
Q4
A — 60 seconds
Q5
B — 80000 bits
Section B: Match the Pairs
Q1
size_bits = rate * resolution * seconds → Calculates the uncompressed sound file size in bits
Q2
size_bytes = size_bits / 8 → Converts the file size from bits to bytes
Q3
Worked example: a 10 second sound sampled at 44100 Hz with 16-bit resolution has this size in bits → 44100 * 16 * 10
Q4
Size in bytes of a 5 second sound at 8000 Hz and 8-bit resolution: multiply to get bits, then divide by 8 → 8000 * 8 * 5 / 8
Q5
size_bits = rate + resolution + seconds → The three values are added instead of multiplied. The size in bits is rate x resolution x seconds.
Q6
size_bytes = rate * resolution * seconds * 8 → The result is multiplied by 8 instead of divided by 8. Bits must be divided by 8 to get bytes.
Section C: Definitions
Q1
size = sample rate x resolution x seconds — Uncompressed sound file size in bits is the sample rate (Hz) times the sample resolution (bits) times the length in seconds. Divide the bits by 8 to get bytes.
Section D: Fill in the Blanks
Q1
bits = rate * resolution * seconds
Q2
bits = rate * resolution * seconds
Q3
bytes = bits / 8
Q4
bytes = bits / 8
Q5
seconds = 2 * 60 bits = 8000 * 8 * seconds
Section E: Spot the Error
Q1
C — The sound length in seconds is missing. File size in bits = sample rate x sample resolution x length in seconds, so the line should be bits = rate * res * 10.
Q2
C — The program works out the size in bytes but then prints the size in bits. It should print the variable bytes.
Q3
D — The three values must be multiplied, not added. The correct line is bits = rate * res * secs.
Q4
A — The sample resolution (16 bits) has been left out. The size in bits is sample rate x sample resolution x length, so it should be bits = 8000 * 16 * 30.
Q5
C — A kibibyte is 1024 bytes, not 1000. The line should be kib = bytes / 1024.