After its last subframe, a frame is padded and closed with a checksum, which brings the stream back to a byte boundary for the next frame.
Padding and CRC-16
Zero bits pad the last subframe out to a byte boundary, if it did not end on one.
Then come 16 bits of CRC, computed over the whole frame from the first byte of the
sync code up to the padding: polynomial x¹⁶ + x¹⁵ + x² + 1
(0x8005), starting from 0, most significant bit first.
What the checks cover
| Check | Covers |
|---|---|
| CRC-8 | The frame header. It is what lets a decoder find a frame in damaged data |
| CRC-16 | The whole frame |
| MD5 | The decoded audio of the whole stream, in STREAMINFO |
A decoder that hits a wrong CRC can skip forward to the next sync code and try again: because every header is checked, only a tiny fraction of false sync codes survive.