How to repair PCM audio file

PCM files are much more easier to repair in comparison to other audio formats. It has no compression but a recognizable structure.

a) Header:

52 49 46 46 00 00 00 00 57 41 56 45 66 6d 74 20
12 00 00 00 01 00 02 00 44 ac 00 00 10 b1 02 00
04 00 10 00 00 00 64 61 74 61 00 00 00 00

b) Ending:

00 00

c) Body is usually represented as columns of data corresponding to high bytes, with typical values around 00 and FF, in pairs of 2 columns:

09 03 00 03 00 03 fb 02 fb 02 f4 02 f4 02 e8 02
e7 02 d1 02 d1 02 b0 02 b0 02 85 02 85 02 54 02
53 02 1b 02 1c 02 dd 01 dd 01 9c 01 9c 01 56 01
57 01 13 01 12 01 cc 00 ce 00 88 00 88 00 48 00
48 00 0d 00 0d 00 da ff da ff b1 ff b1 ff 90 ff
92 ff 79 ff 79 ff 67 ff 67 ff 57 ff 57 ff 44 ff
44 ff 2e ff 2e ff 10 ff 11 ff e9 fe e9 fe bd fe
bd fe 8a fe 8b fe 58 fe 57 fe 26 fe 27 fe fd fd
fc fd db fd db fd c3 fd c2 fd b4 fd b4 fd ac fd
ac fd a9 fd aa fd a5 fd a6 fd 9f fd a0 fd 97 fd
97 fd 8c fd 8c fd 82 fd 82 fd 7b fd 7b fd 7a fd
7a fd 86 fd 85 fd 9c fd 9c fd ba fd ba fd e0

Example:

The damaged header (highlighted “12”) prevents PCM file from opening.PCMerror