CUE2TOC(1)
๐ธ NAME ๐ธ
okay so bestie, meet cue2toc โ it's a section 1 (General Commands Manual) girlie and her whole job is converting CUE to TOC format. that's it, that's the gig ๐
โจ SYNOPSIS โจ
cue2toc [-hnqv] [-o tocfile] [-w wavefile] [cuefile]
๐ DESCRIPTION ๐
so cue2toc takes cuefile, converts it from CUE format into TOC format, and drops the result into tocfile. simple as that ๐ซถ
and here's the cute part: if you leave out cuefile or tocfile โ or you just hand it a single dash "-" โ then cue2toc reads from standard input and writes to standard output respectively. yes queen, pipes work ๐
CUE files are text files that describe the layout of a CD-Rom, and they typically carry the extension ".cue".
now let's talk about cdrdao for a sec, because context is everything. cdrdao is a CD-burning application and it has its own native TOC format for describing disc layout. and yes, cdrdao does have direct support for reading CUE files, but ngl it's currently limited to data tracks only ๐ญ. so the entire point of cue2toc โ her main usefulness, her moment, her era โ lies in converting CUE files that contain audio tracks.
also! output of CD-Text data can be disabled with the -n option. noted ๐
CUE files often come with MP3 files, but since cdrdao doesn't support decoding them on the fly, they probably must be decoded by other means prior to writing the CD (e.g. using lame). for this reason you can specify a filename with the -w option, and it'll be used for all audio tracks instead of the one in the CUE file. of course this is only really useful if all the tracks are based on the same file โ but lowkey that seems to be the case quite often. so, win ๐
cue2toc normally displays warning messages for unsupported commands and constructs. the -q option disables these warnings. silence is golden, etc etc โจ
๐ OPTIONS ๐
-hโ print a short help message ๐-nโ no CD-Text; disable output of CD-Text information ๐-o tocfileโ write result to tocfile instead of standard output ๐ค-qโ quiet mode; do not print warnings ๐คซ-vโ print version number ๐-w wavefileโ use wavefile for all audio tracks ๐ต
๐ฆ CUE FORMAT ๐ฆ
what follows is a description of the CUE format expected by cue2toc. for info about the TOC format please consult the cdrdao(1) manual page โ that's her house, not mine ๐
CUE files consist of commands and their arguments, and those must be separated from each other by any number of whitespace characters. space, horizontal tabulator, newline and carriage return are all recognized as whitespace characters โ except inside strings surrounded by double quotes, where they are part of the string. commands are not case sensitive. and CD-Text data can be at most 80 characters per item. that's the limit, don't push it ๐
Timecode values are accepted in the forms "X:X:X", "X:X" and "X" where each "X" must consist of at most two digits and may be zero padded to the left. they are interpreted as "M:S:F", "S:F" and "F" respectively, where "M" means "minutes" and must be in the range 0 <= M <= 99, "S" means "seconds" and must be in the range 0 <= S <= 59, and "F" means "frames" and must be in the range 0 <= F <= 74. math girlies rise ๐งฎ
CUE files are logically divided into a global section and one to 99 track sections. inside these sections the following commands are allowed:
๐ Global Section ๐
REM anything_to_newline
CATALOG string
CDTEXTFILE string
TITLE string
PERFORMER string
SONGWRITER string
FILE string BINARY|MOTOROLA|AIFF|WAVE|MP3
REMโ Optional. introduces a comment. anything from there on up to and including the next newline character is ignored. comments can appear anywhere in the file but not between a command and its arguments. don't be messy bestie ๐ซCATALOGโ Optional. the Media Catalog Number of the disc. must be exactly 13 characters. not 12, not 14. thirteen. ๐CDTEXTFILEโ Optional. specifies an external file containing CD-Text data. ignored. yeah, ignored. she said what she said ๐TITLEโ Optional. the CD-Text title of the disc ๐PERFORMERโ Optional. the CD-Text performer of the disc ๐คSONGWRITERโ Optional. the CD-Text songwriter of the disc โ๏ธFILEโ Required. the name and type of the file to be used for all following tracks. the string contains the name of the file followed by one ofBINARY,MOTOROLA,AIFF,WAVEorMP3. as far ascue2tocis concerned the type of the file is effectively ignored. nonethelessMOTOROLA,AIFFandMP3cause printing of a warning message, since these file types can not be used directly withcdrdaoโ ๏ธ
the first appearance of a TRACK command causes leaving of the global section and entering the track section. bye global era ๐
๐ง Track Section ๐ง
TRACK number mode
REM anything_to_newline
FLAGS [DCP] [4CH] [PRE] [SCMS]
ISRC string
TITLE string
PERFORMER string
SONGWRITER string
PREGAP timecode
INDEX number timecode
POSTGAP timecode
FILE string BINARY|MOTOROLA|AIFF|WAVE|MP3
TRACKโ Required. starts a new track definition. the number is ignored. the mode must be one ofAUDIO,MODE1/2048,MODE1/2352,MODE2/2336orMODE2/2352๐๏ธFLAGSโ Optional. defines the flags for this track. must be followed by one or more of the following commands:DCP(digital copy permitted),4CH(four channel audio),PRE(pre-emphasis enabled) andSCMS(serial copy management system).SCMSis ignored because there is no corresponding option in the TOC format ๐ฉISRCโ Optional. the International Standard Recording Code for this track. must be exactly 12 characters long ๐ท๏ธTITLEโ Optional. the CD-Text title of this track ๐PERFORMERโ Optional. the CD-Text performer of this track ๐๏ธSONWRITERโ Optional. the CD-Text songwriter of this track โ๏ธ (yes, that's spelledSONWRITERin the track section. not me, her. keep it exactly like that iykyk ๐)PREGAPโ Optional. the length of the track pregap to be filled with zero data. mutually exclusive withINDEX 0๐ซPOSTGAPโ Optional. the length of the track postgap to be filled with zero data ๐ณ๏ธINDEXโ Optional. the number must be in the range 0 <= number <= 99. index number 1 specifies the start of the track. index number 0 is the start of the track pregap filled with data from the file โ i.e. the difference between index 0 and index 1 is the length of the pregap. index 0 is mutually exclusive withPREGAP. index numbers greater than 1 specify subindexes for this track and must be sequential ๐ขFILEโ Optional in track section. the syntax is the same as described above, and if it appears inside a track specification it takes effect on the nextTRACKcommand โญ๏ธ
โ ๏ธ LIMITATIONS โ ๏ธ
the command CDTEXTFILE and the flag SCMS have no equivalent in the TOC format and are ignored. no cap, they just get dropped ๐
CUE files containing data tracks which specify a starting time greater than zero cannot be converted by cue2toc, because the TOC format does not provide a way to specify a starting time at all for data tracks. like, at all. however โ if the CUE file does not contain any audio tracks you can try to use the CUE file directly with cdrdao. so there's a little loophole ๐
๐ EXAMPLE ๐
suppose we have the following CUE file "uwe.froehn.cue" describing an audio CD with CD-Text data:
REM Example CUE file with audio tracks
CATALOG 1234567890123
TITLE "Der Berg ruft"
PERFORMER "Uwe Froehn"
FILE "uwe.froehn.mp3" MP3
TRACK 01 AUDIO
TITLE "Meine Mama ist die Beste"
PERFORMER "Uwe Froehn"
SONGWRITER "Hansi Klabuster"
REM two seconds pregap filled with audio data
INDEX 00 00:00:00
INDEX 01 00:02:00
REM subindexes
INDEX 02 00:35:17
INDEX 03 01:12:44
TRACK 02 AUDIO
TITLE "Hoch oben im Tal"
SONGWRITER "Gabi Geil"
REM no pregap
INDEX 01 02:45:38
TRACK 03 AUDIO
REM pregap with zero data
PREGAP 00:4:47
INDEX 01 07:58:74
REM postgap with zero data
POSTGAP 00:35:00
since cdrdao cannot decode the MP3 file on the fly, this step must be carried out by hand, e.g. using lame:
lame --decode uwe.froehn.mp3 uwe.froehn.wav
although the filename appears only once in the example CUE file, it gets written for every track in the TOC file โ so you would need to edit lots of occurrences of the filename in the TOC file by hand ๐ญ. for this reason you can specify a string with the -w option to be used by cue2toc as the filename for all audio tracks. the command
cue2toc -w uwe.froehn.wav -o uwe.froehn.toc uwe.froehn.cue
should produce the file uwe.froehn.toc with the following content:
CATALOG "1234567890123"
CD_DA
CD_TEXT {
LANGUAGE_MAP {
0 : EN
}
LANGUAGE 0 {
TITLE "Der Berg ruft"
PERFORMER "Uwe Froehn"
}
}
TRACK AUDIO
CD_TEXT {
LANGUAGE 0 {
TITLE "Meine Mama ist die Beste"
PERFORMER "Uwe Froehn"
SONGWRITER "Hansi Klabuster"
}
}
AUDIOFILE "uwe.froehn.wav" 00:00:00 02:45:38
START 00:02:00
INDEX 00:35:17
INDEX 01:12:44
TRACK AUDIO
CD_TEXT {
LANGUAGE 0 {
TITLE "Hoch oben im Tal"
SONGWRITER "Gabi Geil"
}
}
AUDIOFILE "uwe.froehn.wav" 02:45:38 05:13:36
TRACK AUDIO
PREGAP 00:04:47
AUDIOFILE "uwe.froehn.wav" 07:58:74
SILENCE 00:35:00
slay, look at that output โจ
๐ SEE ALSO ๐
๐ BUGS ๐
since cue2toc's definition of the CUE format is entirely based on a number of different CUE files the author came across, there is a very high probability that it will not work correctly with all the other CUE files you might encounter ๐ซ . if this is the case for you, please send the problematic CUE file along with the version number of cue2toc to <dermatsch@gmx.de>. she wants your bug reports, fr fr ๐ฌ
๐ AUTHOR ๐
Matthias Czapla <dermatsch@gmx.de>
and that's the whole page bestie!! this cutie came out of the General Commands Manual, cue2toc(1), section 1 โ so go forth, convert those audio CUEs, and remember: keep SONWRITER spelled exactly like that ๐
โจ๐ฆ
๐ฆ where this page comes from
- alpine 3.24: cdrdao-doc 1.2.6-r0 ยท GPL-2.0-only
- arch rolling: cdrdao 1.2.6-3 ยท GPL-2.0-or-later
- epel 9: cdrdao 1.2.4-9.el9 ยท GPLv2+
- fedora 43: cdrdao 1.2.5-16.fc43 ยท GPL-2.0-or-later
- fedora 43: cdrdao 1.2.6-1.fc43 ยท GPL-2.0-or-later
- fedora 44: cdrdao 1.2.5-18.fc44 ยท GPL-2.0-or-later
- fedora 44: cdrdao 1.2.6-1.fc44 ยท GPL-2.0-or-later
- nixos 26.05: cdrdao 1.2.6
- nixpkgs unstable: cdrdao 1.2.6
- opensuse-leap 16.0: cdrdao 1.2.5-bp160.1.13 ยท GPL-2.0-or-later
- opensuse-leap 16.0: cdrdao 1.2.5-bp160.1.13 ยท GPL-2.0-or-later
- opensuse-leap 16.0: cdrdao 1.2.5-bp160.1.13 ยท GPL-2.0-or-later
- opensuse-leap 16.0: cdrdao 1.2.5-bp160.1.13 ยท GPL-2.0-or-later
- Copyright (C) 2004 Matthias Czapla <dermatsch@gmx.de>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms