User:Wynn Liaw/sandbox/3
Organization of a CDA file
[edit]offset | length | content |
---|---|---|
0x00 | 4 | the 4 ASCII characters "RIFF" |
0x04 | 4 | the size of the following chunk: always 36 (44 - 8), on 4 bytes (Intel order) |
0x08 | 4 | chunk identifier: the 4 ASCII characters "CDDA" |
0x0C | 4 | the 3 ASCII characters "fmt" followed by a space |
0x10 | 4 | length of the chunk: always 24, on 4 bytes (Intel order) |
0x14 | 2 | version of the CD format, on 2 bytes (Intel order). In May 2006, always worth 1. |
0x016 | 2 | number of the range, on 2 bytes (Intel order). The first track has the number 1. |
0x18 | 4 | identifier calculated by Windows for cdplayer.exe. |
0x1c | 4 | range offset, in number of frames (Intel order) |
0x20 | 4 | duration of the track, in number of frames (Intel order) |
0x24 | 1 | range position: frames |
0x25 | 1 | range position: seconds |
0x26 | 1 | range position: minutes |
0x27 | 1 | a null byte (binary value 0) |
0x28 | 1 | duration of the track: frames |
0x29 | 1 | duration of the track: seconds |
0x2a | 1 | duration of the track: minutes |
0x2b | 1 | a null byte (binary value 0) |
The size of a CDA file being fixed, as well as its organization, there is always only one and only chunk, named "CDDA" (meaning Compact Disc for Digital Audio).
The identifier created by Windows is used by the Windows 95 and Windows 98 CD drive (cdplayer.exe). This player cannot connect to FreeDB or CDDB. So that it can display the artist name and song title, you have to manually enter this information in the cdplayer.ini file (in the Windows installation directory), in a section named after that identifier. This identifier has no relation to the DiscId used by FreeDB or CDDB, it is a purely Microsoft creation, for the above use.
The position and length of the tracks use frames as the unit. There are 75 frames per second. This is the smallest block of data that can be read from an audio CD, corresponding to a sector of the CD.
All the information which requires several bytes is coded with the order-byte Intel (small endian).