Introduction
A CD-Text file holds the CD-Text of an audio disc: the album and track titles, the
performers, songwriters, composers and arrangers, a message, the catalogue number, a
genre, the table of contents and the UPC/EAN and ISRC codes, in up to eight languages.
Sony and Philips added CD-Text to the audio CD, and the text is recorded in the unused
sub-channel space of the disc’s lead-in area (Sony’s “What is CD TEXT”). MMC-3,
the SCSI command set for CD drives, describes how that data is stored as 18-byte
packs (Annex J of the MMC-3 draft); a .cdt file is a run of those
packs saved one after another. Sony’s mastering documents call the file the “binary
file for the lead-in area”.
A cue sheet’s CDTEXTFILE
command names such a file; the GNU ccd2cue manual says the libcdio guide “CD Text
Encoding and Decoding Guide” documents the format of that file. Drive software such
as libcdio reads the same packs from a disc.
Other formats use the extension .cdt too (see “Also used for” below). The
explorer opens a file as a CD-Text file only when its bytes are CD-Text packs.
Structure
The file is a whole number of 18-byte packs. Each pack has a 4-byte header (the pack type, a track number, a sequence number and a byte with the block number and the character position), 12 bytes of text or binary data, and a 2-byte CRC. Texts end with a zero byte and run on from pack to pack; the packs are grouped in up to eight blocks, one for each language, and each block ends with three packs that describe it. Two further details are optional: a 4-byte MMC header before the packs, as a drive returns them, and one zero byte after them, as Sony’s binary file has.
- Pack structure: the 18 bytes, the header, the CRC, blocks, how texts are split, the TAB rule, double-byte text, the MMC header and the trailing zero.
- Pack types: the types 0x80 to 0x8f, the genre codes, the table of contents (0x88) and the second table of contents (0x89).
- Block size record: the 36-byte record of the three 0x8f packs, with the character codes and the language codes.
The pages follow the libcdio guide and its reader, the MMC-3 draft revision 10g
(Annex J, the Internet Archive copy) and Sony’s own “CD TEXT authoring and mastering”
documents (the Wayback Machine copy of cdtext.zip), and say where they
differ.
Opening a CD-Text file here
Drop a .cdt file on this site’s explorer to see its packs in a tree (every
byte is in a node), every text by block, type and track, each block’s size record, the
table of contents and the second table of contents, a table of all packs with their CRCs,
and a list of every rule the file breaks, each with its byte offset. Nothing is
uploaded: the file is read in the browser. The reader’s results are compared with Sony’s
own example (its text file, TOC file and hexadecimal dump) and with the real files of
libcdio and libburn.
Not described
Sony’s documents define every field of the packs except the one below, and no source read here says more.
Unknown
- Reference and viewer: byte 3 of the first table-of-contents pack (0x88, track byte 0). The libcdio guide lists it as “unknown, 0 in Sony example”; Sony’s checker tests the bytes around it but not this one. MMC-3’s description of the full table of contents (Table 237) has a disc type byte in its A0 row, but nothing read says this byte is that one. Every file read here holds 0. The pack types page says so, and the viewer shows the byte, labelled “not described by Sony”, in the TOC tab.
- Reference: what a player does with the second table of contents (0x89). Sony’s checker names its fields (priority number, number of intervals, track number, start point, end point) and the libcdio guide guesses that the pack carries the skip intervals of MMC-3’s Mode-5 Q sub-channel, but no document read says what a player does with them. The pack types page gives the fields; the viewer shows them in the TOC tab.
Specs not available
- Reference: chapter 5.8 of the Red Book (IEC 60908), where Sony’s documents say CD-Text is specified: not public. The packs are described here from MMC-3 Annex J and Sony’s documents, which are.
- Reference: Sony’s encoder and checker programs (
CTENCODE.EXE,BINCHECK.EXE) are in the same archive as its documents; they are Windows programs, and were not run. Their rules are read from Sony’s own description of them.
Also used for
- Amstrad CPC tape image – A Spectrum cassette with its timings, so turbo loaders survive.
- CorelDRAW template – CorelDRAW's working file: RIFF chunks in older versions, a ZIP archive since X4.
- Tyrian credits – The game Tyrian's end credits: 131 encrypted Pascal strings, one for each line.
Links
Developers
Reference
- CD Text Encoding and Decoding Guide – libcdio’s description of the packs, pack types, tables and CRC
- libburn: Description of CD-TEXT – libburn’s notes on the packs, with worked examples
- MMC-3 draft revision 10g – the SCSI multimedia command set; Annex J describes the CD-TEXT pack (Internet Archive copy)
- Sony: CD TEXT authoring and mastering – Sony’s documents with an example text file, TOC file and binary file (Wayback Machine copy of
cdtext.zip) - EBU Tech 3264 – Appendix 3 holds the language code table that the block size record uses