Digitizing sound means converting real-world sound into digital data that a computer can store, edit, send, and play back.
Real sound is analog. This means it changes smoothly and continuously. Computers, however, store information using numbers. To save sound on a computer, the sound must be converted into digital numbers.
Examples of digital sound include:
Analog sound is continuous. It can have an unlimited number of possible values as it changes over time.
Examples of analog sound include:
Digital sound is stored as a list of numbers. Each number represents part of the sound wave at a specific moment.
Examples of digital sound include:
| Type | Description | Example |
|---|---|---|
| Analog Sound | Smooth and continuous | Live voice |
| Digital Sound | Stored as numbers | MP3 song |
| Analog Device | Works with continuous signals | Microphone |
| Digital Device | Works with numbers and binary data | Computer |
To record sound, a computer uses a device such as a microphone.
The basic process is:
Sampling means measuring the sound wave at regular time intervals.
A computer cannot store every single point of a real sound wave. Instead, it takes many snapshots of the sound wave. Each snapshot is called a sample.
The sampling rate is how many samples are taken each second. Sampling rate is measured in hertz, or Hz.
| Sampling Rate | Meaning | Common Use |
|---|---|---|
| 8,000 Hz | 8,000 samples per second | Telephone-quality voice |
| 22,050 Hz | 22,050 samples per second | Lower-quality audio |
| 44,100 Hz | 44,100 samples per second | CD-quality audio |
| 48,000 Hz | 48,000 samples per second | Video and film audio |
| 96,000 Hz | 96,000 samples per second | Professional audio |
A higher sampling rate can capture higher frequencies and more detail.
A lower sampling rate uses less storage but may sound less clear.
The Nyquist Theorem explains how fast sound must be sampled to accurately record a frequency.
A sound must be sampled at least twice as fast as the highest frequency being recorded.
Bit depth controls how accurately each sample can represent the loudness of a sound.
Each sample is stored as a number. Bit depth determines how many possible values that number can have.
| Bit Depth | Number of Possible Values | Common Use |
|---|---|---|
| 8-bit | 256 values | Simple or low-quality audio |
| 16-bit | 65,536 values | CD-quality audio |
| 24-bit | 16,777,216 values | Professional audio |
A higher bit depth can store more volume detail and usually sounds cleaner.
A lower bit depth stores less detail and can make audio sound noisy or rough.
Quantization is the process of rounding each sound sample to the nearest digital value.
Since a real sound wave can have unlimited possible values, the computer must round the measurement to a value it can store.
That small difference is called quantization error.
Digital audio files can become large because they store many samples per second.
The size of an uncompressed audio file depends on:
Mono sound uses one audio channel. A mono recording sends the same sound to all speakers or headphones.
Examples of mono audio include:
Stereo sound uses two audio channels: left and right. Stereo can make sound feel like it is coming from different directions.
Examples of stereo audio include:
| Audio Type | Channels | Description |
|---|---|---|
| Mono | 1 | One channel |
| Stereo | 2 | Left and right channels |
When a computer plays sound, it must turn digital numbers back into an analog signal. This process is called digital-to-analog conversion, or DAC.
The process is:
Audio compression reduces the size of an audio file.
There are two main types of audio compression:
Lossless compression reduces file size without permanently removing audio information. When the file is opened or played, the original audio data can be restored.
Examples of lossless formats include:
Lossy compression reduces file size by permanently removing some audio information. It tries to remove sounds that people are less likely to notice.
Examples of lossy formats include:
| Format | Compression Type | Common Use |
|---|---|---|
| WAV | Usually uncompressed | High-quality recording and editing |
| AIFF | Usually uncompressed | Apple professional audio |
| FLAC | Lossless compressed | High-quality music storage |
| MP3 | Lossy compressed | Music and podcasts |
| AAC | Lossy compressed | Streaming, phones, videos |
| OGG | Lossy compressed | Games and open-source projects |
Bit rate measures how much data is used each second of audio. Bit rate is usually measured in kilobits per second, or kbps.
| Bit Rate | Common Quality |
|---|---|
| 64 kbps | Low-quality voice |
| 128 kbps | Acceptable music quality |
| 192 kbps | Good music quality |
| 320 kbps | High-quality MP3 audio |
Digital sound is important in computer science, games, and app development.
Games use digital audio for:
Examples:
Clipping happens when a sound is too loud for the system to record or store correctly. The top or bottom of the wave gets cut off. Clipping usually sounds distorted or harsh.
Noise is unwanted sound in a recording.
Examples of noise include:
Aliasing happens when the sampling rate is too low to correctly represent a sound frequency. This can cause false or incorrect sounds in the recording.
Digitizing sound allows people to:
| Term | Meaning |
|---|---|
| Analog Sound | Sound that changes smoothly and continuously |
| Digital Sound | Sound stored as numbers |
| Digitizing | Converting analog information into digital data |
| Microphone | Device that detects sound vibrations |
| ADC | Analog-to-digital converter |
| DAC | Digital-to-analog converter |
| Sample | One measurement of a sound wave |
| Sampling | Measuring a sound wave at regular intervals |
| Sampling Rate | Number of samples taken per second |
| Hertz | Unit that means cycles or samples per second |
| Bit Depth | Number of bits used to store each sample |
| Quantization | Rounding analog values to digital values |
| Quantization Error | Small difference caused by rounding |
| Channel | One stream of audio data |
| Mono | Audio with one channel |
| Stereo | Audio with two channels |
| Compression | Reducing file size |
| Lossless Compression | Compression that keeps all original data |
| Lossy Compression | Compression that permanently removes some data |
| Bit Rate | Amount of audio data used per second |
| Clipping | Distortion caused by audio being too loud |
| Aliasing | Error caused by sampling too slowly |