💻 Computer Science · Topic 17 of 80

Sound and Digital Audio

Sound is sampled thousands of times per second.

Interactive labTune the wave and watch it travel

About this topic

Sound is a wave of changing air pressure. To store it digitally, a computer samples the wave, measuring its height many times each second and storing each measurement as a number. The sample rate is the number of samples per second, and the bit depth is the number of bits per sample.

CD audio uses 44,100 samples per second at 16 bits for each of two channels. Higher sample rates and bit depths capture the wave more accurately but create larger files. The Nyquist rule says the sample rate must be at least twice the highest frequency you want to capture, and since humans hear up to about 20,000 Hz, 44.1 kHz is enough.

File size equals sample rate times bit depth times channels times seconds, so one minute of CD stereo is about 10 megabytes. Formats like MP3 compress sound by discarding parts that humans barely hear. A common misconception is that digital audio is always worse than analogue; with enough samples the difference cannot be heard. Another is that higher numbers always sound better, when headphones and recording quality matter too. Recording voices at 44.1 kHz is plenty.

Key ideas

  1. Sample rate in Hz
  2. Bit depth
  3. MP3 compresses audio

Quick check

Use cases: where Sound and Digital Audio helps

Computing ideas run phones, search engines, games and the wider internet.

Frequently asked questions

What is Sound and Digital Audio?

Sound is sampled thousands of times per second.

What will I learn in Sound and Digital Audio?

Sample rate in Hz. Bit depth. MP3 compresses audio.

Is Sound and Digital Audio part of Computer Science?

Yes. It is one of 80 Computer Science topics on LearnViz HighSchoolEdu, with 3 key ideas, a live animation and a quick check.

Does the Sound and Digital Audio lab work on a phone or tablet?

Yes. The animation resizes to fit your screen and supports touch, so you can drag, tap and slide with your finger.

How should I study Sound and Digital Audio?

Read the summary and key ideas first, play with the interactive lab to see the idea in motion, then answer the quick check. If you get a question wrong, go back to the key idea it tests.

Do I need an account, and is my progress saved?

No account is needed. Marking a topic as learned is saved in your own browser, so it stays on that device and is not sent to a server.

More in Computer Science