VOGONS


First post, by truth_deleted

User metadata

There is a reported bug (for example) in the sdl_sound library where the length of a compressed CD audio track is not correctly measured across all audio compression formats; however, the OGG format works perfectly. I confirmed this by compiling dosbox with sdl_sound + FLAC (1.3.0 compiles with mingw32) format support. Ykhwong's build of dosbox has a patch for MP3 playback and a workaround for this bug, but FLAC formatted audio plays with static and at the incorrect speed. It is possible that another bug exists, although I did not test different versions of FLAC formatted files (it is somewhat possible that a different encoder, setting or tag will have an influence on FLAC playback in dosbox+sdl_sound).

OGG is an ideal compression format (licensing scheme and quality of compression) to store CD audio tracks. With the recent gog.com release of a number of FLAC formatted CD audio tracks, it is reasonable to encode the FLAC tracks in the OGG format using a very high quality setting and mount them in dosbox (cue/bin format). This would be an overall improvement to the previously released CD audio tracks which were typically encoded at low to medium bitrates.

Using ffmpeg in Windows (available for other operating systems; win32 download), the FLAC files will convert to OGG format; for example:

ffmpeg.exe -i track002.flac -acodec libvorbis -b:a 320k track002.ogg

or in batch using the msys/mingw32 bash shell:

for i in *.flac; do ffmpeg.exe -i $i -acodec libvorbis -b:a 320k `basename $i .flac`.ogg;done

The bitrate may be increased further, although much (non-anecdotal) evidence has shown that it provides no advantage. The 320k is already higher than the suggested optimal setting. Given a cue sheet file is available for a particular game, then mount the "cue" sheet file in dosbox which points to an iso image (even if one is generated without apparent files) and the OGG compressed CD audio track files.

Reply 1 of 1, by truth_deleted

User metadata

Updated MP3CUE patch (attached) for current dosbox-SVN code. It will apply against current SVN code, but the code itself is unmodified code from this author and source: http://sourceforge.net/p/dosbox/bugs/261. This patch enables the use of MP3 encoded files in a CUE/BIN (CD audio tracks) arrangement in dosbox. It is reliant on the Sound_GetDuration function which is in the developmental branch of the sdl_sound library (mercurial version). This function is not available in the stable branch of the sdl_sound library and therefore the "stable branch" code would rely on the older Sound_Seek function. However, the Sound_Seek function does not work with MP3 files, hence the switch to Sound_GetDuration and the requirement of compiling the developmental branch of sdl_sound.

This patch is not required for playback of OGG encoded files in a CUE/BIN arrangement in dosbox. OGG is functioning with or without this patch; although sdl_sound is required in any case to playback compressed CD audio files in a CUE/BIN arrangement.

There is an apparent bug in the seeking function in the sdl_sound library where accessing FLAC encoded files. I verified the quality of my FLAC encoded files by interconverting them between working formats. Therefore, it should not be the encoder software causing this problem; although I haven't experimented with the metatags. Suggest converting FLAC files to OGG format as outlined in the above parent post. If instead only MP3 files are available, then applying this patch to dosbox would be necessary. Note that Ykhwong's build has already incorporated this patch.

To explain further the CUE/BIN arrangement, the cue sheet may be formed like this:

FILE "test.iso" BINARY
TRACK 01 MODE1/2048
INDEX 01 00:00:00
FILE "track002.ogg" OGG
TRACK 02 AUDIO
PREGAP 00:02:00
INDEX 01 00:00:00
FILE "track003.ogg" OGG
TRACK 03 AUDIO
INDEX 01 00:00:00
FILE "track004.ogg" OGG
TRACK 04 AUDIO
INDEX 01 00:00:00

The ISO file may be empty of files. The tracks do not require a length. Also, even though the tag is required, "OGG", it is not recognized by software and so mp3 files or any other encoded files may be included while tagging them as OGG in the cue sheet. It should be obvious that the compressed audio files must accompany the CUE and BIN (ISO in this case) files. If the MODE line is causing a problem with the data track, try MODE2/2352.

Attachments

  • Filename
    dosbox-mp3cue-2.diff
    File size
    1.51 KiB
    Downloads
    125 downloads
    File comment
    MP3CUE updated for dosbox-SVN
    File license
    Fair use/fair dealing exception