First post, by truth_deleted
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.