Cuesheet

From DOSBoxWiki
Revision as of 19:22, 15 August 2008 by Gilgamesh (talk | contribs) (short howto on creation and mounting CUE/BIN and compression of audio tracks)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Cuesheet

Cuesheet is a file format that specifies track structures of mixed mode compact discs. It can be used with DOSBox, when a game needs to access audio tracks of its CD that is stored as an image file. The prevalent ISO format can only store data tracks.

The CUE/BIN format for CD images

Cuesheets usually come as a CUE/BIN pair. The cuesheet, e.g. image.cue, is an ASCII text file that stores the access information for the “disc at once” binary dump, e.g. image.bin, of the CD's contents. (For more info on the cuesheet file format see here.)

Mounting a CUE/BIN pair is done in the usual way with

Z:\>IMGMOUNT E C:\Images\MyImage.cue -t iso

An exemplary cuesheet is:

FILE "image.bin" BINARY
  TRACK 01 MODE1/2352
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    PREGAP 00:02:00
    INDEX 01 35:17:41
  TRACK 03 AUDIO
    INDEX 01 37:37:70
  TRACK 04 AUDIO
    INDEX 01 39:02:74
  TRACK 05 AUDIO
    INDEX 01 41:34:17
  TRACK 06 AUDIO
    INDEX 01 43:43:29
  TRACK 07 AUDIO
    INDEX 01 46:35:11
  TRACK 08 AUDIO
    INDEX 01 48:47:52
  TRACK 09 AUDIO
    INDEX 01 51:29:30
  TRACK 10 AUDIO
    INDEX 01 53:43:54
  TRACK 11 AUDIO
    INDEX 01 56:28:53
  TRACK 12 AUDIO
    INDEX 01 58:53:44
  TRACK 13 AUDIO
    INDEX 01 60:53:66

Windows

Use a CD burning application like CDRWIN that can write image files in cuesheet format. (An alternative to mounting the CUE/BIN images directly with DOSBox is to load it with the Daemon Tools or similar virtual drives and mount that volume instead like a normal CD-ROM.)

Linux

In order to produce a CUE/BIN pair with Linux use the commands

> cdrdao read-cd --datafile image.bin --driver generic-mmc:0x20000 --device /dev/cdrom --read-raw image.toc
> toc2cue image.toc image.cue

The option --driver generic-mmc:0x20000 takes care of the correct byte order. Omitting it would lead to noise instead of music.

Compressed audio tracks

Another advantage of cuesheets is the possibility to compress audio tracks. The image of a CD's contents can split into an ISO image of the data track and one or more compressed files in OGG or MP3 format for the audio tracks. This method can drastically reduce the image's size without a substantial loss of audio quality.

First you have to rip and encode the audio tracks. The the cuesheet will have to be edited. Mind the changes for the first TRACK and the INDEX tags.

FILE "image.iso" BINARY
  TRACK 01 MODE1/2048
    INDEX 01 00:00:00
FILE "track02.ogg" MP3
  TRACK 02 AUDIO
    PREGAP 00:02:00
    INDEX 01 00:00:00
FILE "track03.ogg" MP3
  TRACK 03 AUDIO
    INDEX 01 00:00:00
FILE "track04.ogg" MP3
  TRACK 04 AUDIO
    INDEX 01 00:00:00
FILE "track05.ogg" MP3
  TRACK 05 AUDIO
    INDEX 01 00:00:00
FILE "track06.ogg" MP3
  TRACK 06 AUDIO
    INDEX 01 00:00:00
FILE "track07.ogg" MP3
 TRACK 07 AUDIO
    INDEX 01 00:00:00
FILE "track08.ogg" MP3
  TRACK 08 AUDIO
    INDEX 01 00:00:00
FILE "track09.ogg" MP3
  TRACK 09 AUDIO
    INDEX 01 00:00:00
FILE "track10.ogg" MP3
  TRACK 10 AUDIO
    INDEX 01 00:00:00
FILE "track11.ogg" MP3
  TRACK 11 AUDIO
    INDEX 01 00:00:00
FILE "track12.ogg" MP3
  TRACK 12 AUDIO
    INDEX 01 00:00:00
FILE "track13.ogg" MP3
  TRACK 13 AUDIO
    INDEX 01 00:00:00

Warning: The length for the compressed audio tracks will never exactly match the original play length. It will deviate some frames (1 frame = 1/75 sec) from the correct values.

The ISO-image of the data track can be mastered with any CD Burning application.

Linux

In order to rip and encode the audio tracks you can use the commands

> cdparanoia -B "2-"
> oggenc *.wav