CD-DA audio

Many DOS games from the mid-1990s onwards used CD-DA (Red Book audio) tracks for music. These are standard audio tracks on a CD-ROM that bypass the sound card entirely, delivering studio-quality pre-recorded music directly from the game disc. dosbox-automation supports CD-DA playback from disc images with audio tracks in various formats.

CD-DA playback requires no special configuration. Mount a disc image with audio tracks using the MOUNT command and the game will handle playback automatically.

Physical CD-ROM drives

dosbox-automation can play CD-DA audio directly from physical CD-ROM drives connected to your computer. Mount the drive using the MOUNT command with -t cdrom and the host path to the disc:

  • Windows: mount D d:\ -t cdrom
  • Linux: mount D /mnt/cdrom -t cdrom

Physical drives are auto-detected from the host path. On Linux, the mount point (e.g., /mnt/cdrom) is resolved to the underlying device automatically. USB CD-ROM drives are also supported.

CD audio from physical discs is read and routed through the DOSBox mixer, so it can be mixed with other audio sources and controlled via the MIXER command. Each mounted physical drive gets its own mixer channel (CDAUDIO_0 for the first drive, CDAUDIO_1 for the second, and so on).

Supported disc image formats

CD-DA audio tracks are supported in the following disc image formats:

  • CUE/BIN - CUE sheet with binary data files. This is the most common format for disc images with audio tracks. Audio tracks can be stored as raw PCM in the BIN file or as separate compressed audio files (see below).

  • MDS/MDF - Alcohol 120% disc image format

  • ISO - Standard ISO 9660 images. Note: ISO images only contain data tracks; they cannot contain audio tracks. Use CUE/BIN for discs with audio.

Supported audio track formats

When using CUE sheets, audio tracks can reference compressed audio files instead of raw PCM data in BIN files. The following audio formats are supported:

  • FLAC - Free Lossless Audio Codec; recommended for lossless archival quality. Typically achieves 35-50% compression with binary-identical output.
  • Opus - Modern lossy codec with excellent quality at low bitrates. Outperforms MP3 and Vorbis at every bitrate.
  • Ogg Vorbis - Widely used lossy codec
  • MP3 - MPEG-1 Audio Layer III (also supports MP2 and MP1)
  • WAV - Uncompressed PCM audio
  • Wave64 - Sony's 64-bit extension of WAV (.w64), supporting files larger than 4 GB

Audio tracks can use sample resolutions of 16-bit or 24-bit, sample rates from 11.025 kHz up to 96 kHz (including 22.05, 44.1, 48, and 88.2 kHz), and mono or stereo channels. You can mix and match these properties across tracks within the same CUE sheet.

The standard Red Book audio format is 44.1 kHz, 16-bit stereo PCM. Mono audio tracks are automatically converted to stereo during playback.

Encoding CD-DA tracks

If you have CD-DA tracks as WAV files (e.g., ripped from an original disc), you can compress them to save disk space while keeping full compatibility.

Lossless compression with FLAC

For devices with sufficient storage, FLAC is recommended. It produces binary-identical output on playback while reducing file sizes by roughly half:

flac -8 --output-name=track02.flac track02.wav
metaflac --add-seekpoint=1s track02.flac

The -8 flag selects maximum compression. Adding seekpoints with metaflac allows fast seeking within the track.

Lossy compression with Opus

Opus is the best choice when storage space is tight, such as on ARM single-board computers. It provides better quality than MP3 or Vorbis at every bitrate.

For CD-DA tracks consisting of speech or narration:

opusenc --speech --bitrate 24 --downmix-mono track02.wav track02.opus

For sound effects and relatively simple music, a bitrate between 54 and 70 works well. More complex musical tracks may need up to 84:

opusenc --bitrate 70 track02.wav track02.opus

Tip

If your audio tracks are encoded at 48 kHz (the default internal rate for Opus), you can set rate = 48000 in the [mixer] section to avoid resampling through the audio chain. Most sound cards, USB speakers, and HDMI interfaces operate at a native rate of 48 kHz.

CUE sheet example

A CUE sheet can reference tracks in different formats. Here is an example using several codecs in one disc image:

FILE "data.iso" BINARY
  TRACK 01 MODE1/2048
    INDEX 01 00:00:00

FILE "track02.opus" OPUS
  TRACK 02 AUDIO
    PREGAP 00:02:00
    INDEX 01 00:00:00

FILE "track03.flac" FLAC
  TRACK 03 AUDIO
    INDEX 01 00:00:00

FILE "track04.mp3" MP3
  TRACK 04 AUDIO
    INDEX 01 00:00:00

FILE "track05.ogg" OGG
  TRACK 05 AUDIO
    INDEX 01 00:00:00

FILE "track06.wav" WAV
  TRACK 06 AUDIO
    INDEX 01 00:00:00

Mixer channel

CD-DA audio is output to the CDAUDIO mixer channel for mounted CD-ROM images.