My sample cuesheet look like this
REM GENRE Soundtrack
REM DATE 2009
PERFORMER "Christian Marcussen"
TITLE "Operation Flashpoint: Dragon Rising"
FILE "Christian Marcussen - Operation Flashpoint - Dragon Rising.wav" WAVE
TRACK 01 AUDIO
TITLE "Menu Theme"
PERFORMER "Christian Marcussen"
INDEX 01 00:00:00
TRACK 10 AUDIO
TITLE "End Credits"
PERFORMER "Christian Marcussen"
INDEX 01 05:57:39
So only first and last track.
And this is my cmd line
flac.exe --force --no-utf8-convert --compression-level-0 --tag "ALBUMARTIST=!albumartist!" --tag "DISCNUMBER=!discnumber!" --tag "TOTALDISCS=!totaldiscs!" --cuesheet="Christian Marcussen - Operation Flashpoint - Dragon Rising.cue" --picture="Christian Marcussen - Operation Flashpoint - Dragon Rising" "Christian Marcussen - Operation Flashpoint - Dragon Rising.wav"
Error msg
Error parsing cuesheet on line 10: CD-DA TRACK numbers must be sequential
Encoding won't start. Why? What's the point? How to ignore this ridiculous restriction?
If "TRACK 10 AUDIO" set to "TRACK 02 AUDIO" in the cuesheet - warning:
WARNING cuesheet is not audio compliant: CD-DA cue sheet lead-out offset must be evenly divisible by 588 samples
Encoding starts and finishes. The output flac in foobar2k doesn't look good
(http://i.imgur.com/SqOB8jJ.png)
What is happening?
Encoding won't start. Why? What's the point? How to ignore this ridiculous restriction?
Don't (ab)use CUE sheets: they describe audio layout on CD disks, not some arbitrary data.
Encoding starts and finishes. The output flac in foobar2k doesn't look good [...] What is happening?
FLAC and foobar2000 use CUE sheets in 2 different incompatible ways. And IMHO FLAC --cuesheet option is pretty much obsolete.
I have tons of albums and singles from them ripped with EAC to WAV+CUE, want to use FLAC format for archiving that collection and playing it with foobar2k. What method of encoding and embedding track information and cover art would You recommend?
Try using CUETools, it can handle most types of cuesheets (unlike foobar2000 which can't handle non-compliant cuesheets). It can convert from and to most formats as well.
Try --tag-from-file="CUESHEET=image.cue" (https://xiph.org/flac/documentation_tools_flac.html#flac_options_tag_from_file) instead of --cuesheet="image.cue" (https://xiph.org/flac/documentation_tools_flac.html#flac_options_cuesheet)
foobar2k can read the CUESHEET tag.
edit: The file extension in the CUESHEET tag doesn't change. This shouldn't matter in foobar2k but it might in other programs. You can use foobar2k to edit the FILE line in the embedded CUESHEET tag from .wav to .flac.
Error msg
Error parsing cuesheet on line 10: CD-DA TRACK numbers must be sequential
Encoding won't start. Why? What's the point? How to ignore this ridiculous restriction?
http://digitalx.org/cue-sheet/syntax/#track (http://digitalx.org/cue-sheet/syntax/#track)
Rules:
All track numbers must be between 1 and 99 inclusive. The first track number can be greater than one, but all track numbers after the first must be sequential. You must specify at least one track per file.
Try --tag-from-file="CUESHEET=image.cue" (https://xiph.org/flac/documentation_tools_flac.html#flac_options_tag_from_file) instead of --cuesheet="image.cue" (https://xiph.org/flac/documentation_tools_flac.html#flac_options_cuesheet)
foobar2k can read the CUESHEET tag.
No erros during encoding/embedding cue.
Looks like the cuesheet is embedded into flac file.
(http://s5.postimg.org/m9adcjpyv/screenshot_1.png)
However, foobar2k doesn't seems to read CUESHEET tag.
(http://s5.postimg.org/j4zpfr96f/screenshot_2.png)
Do I have to enable/change something in foobar2k's config?
That's probably because foobar2000 treats this cuesheet as invalid (track 10 immediately after track 01).
Nope. Changed the TRACK 10 to TRACK 02 in the cuesheet - same results.
I took a wav file and encoded it to flac:
flac test.wav --tag-from-file CUESHEET=test.cue -o out.flac
(the cuesheet was copied to a file from the 1st post).
foobar2000 is able to see the embedded cuesheet and shows two tracks: 01 - Menu Theme and 10 - Credits (so I was wrong when I assumed that to be a problem).
It seems that your CUE file is in UTF-8 format with BOM, and FLAC copies BOM from the file to the tag. And foobar2000 doesn't like BOM in the beginning of the cuesheet tag.
From operations_shorthand_vorbiscomment.c in metaflac source:
case OP__SET_VC_FIELD:
#ifdef _WIN32 /* do not convert anything or things will break */
ok = set_vc_field(filename, block, &operation->argument.vc_field, needs_write, true);
#else
ok = set_vc_field(filename, block, &operation->argument.vc_field, needs_write, raw);
#endif
So, in Windows, metaflac --set-tag-from-file always copies raw data in the file as if --no-utf8-convert was specified.
I guess it's because command line arguments are always unicode in Windows, so it's reasonable and fine for --set-tag=FIELD.
As for --set-tag-from-file, it may not be so good.
Do flac/metaflac know what to do with BOM bytes?
Do flac/metaflac know what to do with BOM bytes?
No.
It seems that your CUE file is in UTF-8 format with BOM, and FLAC copies BOM from the file to the tag. And foobar2000 doesn't like BOM in the beginning of the cuesheet tag.
Yeah... In the meantime I've done some testing and the results pointed to cuesheet encoding (UTF-8 with BOM). Got some cuesheets with non-ANSI characters. Any suggestions how to encode them for f2k to displays those characters correctly?
Any suggestions how to encode them for f2k to displays those characters correctly?
Try this: create a CUE file in UTF-8 encoding, but without BOM mark. Then encode it as:
flac --no-utf8-convert --tag-from-file CUESHEET=file.cue -5 test.wav -o out.flac
Yes! It worked. This concludes the battle... Thanks for all the help