Sampling and storing sound in digital form
Introduction
Sound is used by computer games, music programs and other applications on a computer system. How is sound put into a form that a computer can understand and how can sound stored inside a computer be played through speakers?
Recording sound digitally and playing it back
When you speak or play music into a microphone, the microphone takes the sound waves and converts them into a voltage. As the sound waves vary, so the voltage varies. The microphone is connected to a computer's sound card. The sound card samples the microphone's voltage at intervals. How many times it does this in a second is known as the 'sample rate'. The time between samples is the 'sample interval'. The bigger the gap between taking a sample, (in other words the larger the sample interval), the lower the quality of the recording, although the benefit is a smaller file size. Each time the voltage is sampled, it is converted into a binary number by the sound card's Analogue to Digital Converter (ADC) and stored. If you store all of the digital samples, you end up with a sound file. This might be a song or a recording of your voice, for example.
To play back a sound file through some speakers, the sound file is passed back to the sound card, into which the speakers are connected. The Digital to Analogue Converter (DAC) on the sound card takes the digital signals that make up the sound file and converts them back into analogue signals. They are then passed out to the speakers and the sound is played.