What does the sample rate and sample size of audio means?

In a MP3 audio file, I know theres a bitrate of audio which tells the number of bits in seconds are being used by the player, in other words a measure of quality of audio.

But I'm confused with the terms sample rate and sample size. Are they independent of the bitrate or quality of sound? or Can it be explained in some understandable terms?

Yes, they are independent of the bitrate and they both directly affect the "quality" of a digital recording.

Sampling Rate

At a basic level, digital audio is recorded by approximating the positions of an audio signal over time. The Wikipedia article on sampling rate has a pretty good picture of how this works, which I'll link here:

You can see that the audio waveform (in blue) is approximated by recording its position (the black dots) at each of several regularly-spaced positions in time. Each of those "samples" is stored as a number, referring to the height of the wave at that point. The sampling rate is how many of those samples are taken per second.

So in the CD-standard 44.1KHz that you've probably seen, that means that 44.1 thousand samples are taken each second.

Sample size

I'm not sure exactly what sample size means in this context, since I'm unfamiliar with the term. I think it might be referring to what I usually call bit depth, which is the resolution of the samples described above. So if you're using 16-bit digital audio, each one of those samples has 16 bits worth of data, or 2^16 possible positions it can record, from the lowest position to the highest. Higher bit depth means higher-resolution audio and a better representation of the original wave.

So how does this tie in to bit rate?

Keep in mind that all of this that I've described so far is fairly straightforward audio recording. This is before anything clever like MP3 compression gets applied. Lossy compression like MP3 does not store the samples themselves, but rather enough data to approximate the samples in a clever way upon decoding. It takes much less data (fewer bits per unit of time, hence the term bit rate) but is only ever going to be an approxmation. The higher the bit rate, the better that approxmation is, at the cost of filesize.

• Explicitly: If the audio is uncompressed, then bit rate = sample rate × bit depth. Commented Feb 11, 2012 at 1:05