# Representing Sound

The KS3 National Curriculum for Computing requires that students know how sound is stored inside the computer. In addition, GCSE Computer Science also requires that you understand the impact of sampling rate and sample size on the recorded sound.

You probably recall from your science lessons that sound travels as a wave. The amplitude (i.e. height) of the wave represents the volume and the frequency of the undulations in the wave indicates the pitch/note. When a sound is recorded it is stored inside the computer as a series of numbers that represent the amplitude of the wave. Each time the height of the wave is measured, it is called a *sample*, and samples are taken at regular intervals called the *sampling rate* or *sampling frequency*. The number of bits used to record the sample is called the *sample size* (or sometimes the *bit depth*). For the sound to be replayed correctly at the right speed the *metadata* would need to include the sample rate and sample size - for music tracks the metadata will also include information such as the artist name, song title and track number.

On this page you can make a short sound recording (up to 10 seconds) and see the wave. If you zoom in enough, you can see the individual samples as vertical bars. Recordings should have a sampling frequency of 48,000Hz (the same as television and DAB) and a sample size of 16 bits (if your browser supports those constraints). NB. If your browser doesn't sample at 48kHz then the number of samples will be wrong.