The MP3 file format consists of frames. Each frame starts with eleven "1" bits and also a couple bytes of metadata controlling the bit rate and defining some other attributes. Each frame is independent, it was designed this way to support streaming.
Frames can have a CRC - an error check. It's optional.
The operating system will likely retry reading if it encounters bad sectors on a CD (CD hardware has its own error checking mechansim before the MP3 encoder even sees anything). Assuming the decoder is not working off of a buffer, the decoder won't receive new data during this process and will have to stop. If the operating system can't read the data, it may report an error to the operating system, which will eventually be reported to the process hosting the MP3 encoder. Depends on the software what happens exactly here.
A couple of possible things can happen if the data from CD is read incorrectly and still makes it to the decoder (this probably would not happen on a PC but could in a car stereo or other non-PC device):
An MP3 decoder looks for those eleven 1 bits to find the start of a frame - if it doesn't find them it will probably stop decoding until the next frame.
If the header data is bad, it may play the frame at the wrong bitrate since the byte indicating which bitrate may be wrong.
If the header CRC bit is set and the CRC doesn't match, the decoder will probably throw the frame out and not play it. Most MP3 files don't have the CRC bit set.
If the payload (data after the header) is wrong, the MP3 decoder will try to play it.
A decoder's job is to take the compressed data and generate uncompressed data to hand over to an "upper" level. That upper level actually uses the uncompressed data to drive an audio device. I would hazard to guess most encoders/audio driver setups have a buffer - with a configurable size - where the MP3 decoder can build up some data for the audio driver and allow retrying of reads.
So, anyway, if the decoder has stopped because it's not getting data, the upper level actually driving the audio might do any of the below:
- Upper level outputs silence. You would hear a break in the audio.
- Decoder stops filling data into an audio buffer, but upper level continues playing what is there. Audio buffers are typically "circular" which means they are not zeroed out but constantly overwritten with new data. You will hear a skip which is a portion of the previous audio playing.
- Upper level is smart and tries to interpolate what "should" be there. I don't think this is very common.
If the decoder outputs bad data, you will hear static or pops in the audio.
Reference.
2@AFH doesn't that advice apply to every question ever? Perhaps he doesn't have a damaged CD to try it and doesn't feel like damaging one just to find out. – RyanfaeScotland – 2018-04-13T23:03:53.240
7You don't "burn" an MP3 from a CD. "Burning" refers specifically to writing data to an optical disk of some kind (CD, DVD, BluRay). – jpmc26 – 2018-04-13T23:09:07.897
@RyanfaeScotland - It applies to questions with far too little information to allow a reasonable answer. But I take your point that the question may be hypothetical, though a CD-R costs 10-20p, so it's not exactly an expensive test. – AFH – 2018-04-13T23:22:13.190
@AFH Ha, the idea of burning a CD just to damage to then try and rip again never occurred to me! My collection is safe. – RyanfaeScotland – 2018-04-14T00:05:13.563