Help - Search - Members - Calendar
Full Version: Valid track offsets in cuesheet files for flacs
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
gharris999
I know I’ve seen this topic discussed here before, but I can’t seem to find a reference to it.

When creating encoding a flac from a WAV file that wasn’t ripped from a CD, what are the rules for the wav file size? Does the file size and audio data size need to be a multiple of some value?

Also, what are the rules for valid cuesheet index entries?

Here is an example of where I’m having trouble:

I’ve got a 513,559kb WAV file, two channel, 16bit, 48hkz. The file was created using Goldwave capturing the audio of a DVD in real-time. I then created a cuesheet with the following 4 tracks:
CODE
PERFORMER "Beethoven, L"
COMPOSER "Beethoven, L"
TITLE "Symphony No. 3 - Orchestre Révolutionnaire et Romantique, Gardiner"
GENRE "h_Classical"
YEAR "2004"
FILE "Symphony No. 3 - Orchestre Révolutionnaire et Romantique, Gardiner.flac" WAVE
COMMENT "Ludwig van Beethoven (b Bonn, bap. 17 Dec 1770; d Vienna, 26 March 1827 ); Symphony No. 3 in Eb; Orchestre Révolutionnaire et Romantique; John Elit Gardiner, cond.; "
 TRACK 01 AUDIO
   TITLE "Symphony No. 3 in Eb, »Eroica« Op. 55 (1805) - 1 Allegro con brio"
   PERFORMER "Beethoven, L"
   COMPOSER "Beethoven, L"
   GENRE "h_Classical"
   YEAR "1990"
   INDEX 01 00:00:00
 TRACK 02 AUDIO
   TITLE "  2 Marcia funebre - Adagio assai"
   PERFORMER "Beethoven, L"
   COMPOSER "Beethoven, L"
   GENRE "h_Classical"
   YEAR "1990"
   INDEX 01 13:52:45
 TRACK 03 AUDIO
   TITLE "  3 Scherzo - Allegro vivace"
   PERFORMER "Beethoven, L"
   COMPOSER "Beethoven, L"
   GENRE "h_Classical"
   YEAR "1990"
   INDEX 01 28:15:00
 TRACK 04 AUDIO
   TITLE "  4 Finale - Allegro molto"
   PERFORMER "Beethoven, L"
   COMPOSER "Beethoven, L"
   GENRE "h_Classical"
   YEAR "1990"
   INDEX 01 33:53:00


FB2K loads and plays the cuesheet / flac file just fine. Slimserver (all versions, including 6.5 beta) can’t read the cuesheet file as valid. It complains about invalid track offsets.

Is there a way to calculate what a valid track offset would be? Josh??
Synthetic Soul
I'm not sure if it is your only problem, but your cuesheet is invalid due to the GENRE, DATE, etc. statements.

Try swapping it with this one, where I have converted these to REM statements:

CODE
PERFORMER "Beethoven, L"
TITLE "Symphony No. 3 - Orchestre Révolutionnaire et Romantique, Gardiner"
REM COMPOSER "Beethoven, L"
REM GENRE "h_Classical"
REM YEAR "2004"
REM COMMENT "Ludwig van Beethoven (b Bonn, bap. 17 Dec 1770; d Vienna, 26 March 1827 ); Symphony No. 3 in Eb; Orchestre Révolutionnaire et Romantique; John Elit Gardiner, cond.; "
FILE "Symphony No. 3 - Orchestre Révolutionnaire et Romantique, Gardiner.flac" WAVE
TRACK 01 AUDIO
TITLE "Symphony No. 3 in Eb, »Eroica« Op. 55 (1805) - 1 Allegro con brio"
PERFORMER "Beethoven, L"
REM COMPOSER "Beethoven, L"
REM GENRE "h_Classical"
REM YEAR "1990"
INDEX 01 00:00:00
TRACK 02 AUDIO
TITLE " 2 Marcia funebre - Adagio assai"
PERFORMER "Beethoven, L"
REM COMPOSER "Beethoven, L"
REM GENRE "h_Classical"
REM YEAR "1990"
INDEX 01 13:52:45
TRACK 03 AUDIO
TITLE " 3 Scherzo - Allegro vivace"
PERFORMER "Beethoven, L"
REM COMPOSER "Beethoven, L"
REM GENRE "h_Classical"
REM YEAR "1990"
INDEX 01 28:15:00
TRACK 04 AUDIO
TITLE " 4 Finale - Allegro molto"
PERFORMER "Beethoven, L"
REM COMPOSER "Beethoven, L"
REM GENRE "h_Classical"
REM YEAR "1990"
INDEX 01 33:53:00

I can't see that the INDEX values can be illegal, as they are valid frame values. That said, as you say, I do remember a thread regarding FLAC disliking a file as it had an incorrect number of samples, meaning that it was an invalid audio CD file.

Edit: I recently ripped the audio from a DVD also. This thread may be of interest.

Edit 2: Added link to thread "invalid samples" thread.
gharris999
Only EAC has a problem with the extra metadata in the cuesheet. Neither FB2K nor slimserver have a problem with the extra metadata. As far as I know, there isn't a standard for cuesheet tag content.

The "invalid" ness of the cuesheet specifically has to do with the track index offsets, as far as slimserver is concerned, at least going by the debug messages it spits out with --d_scan. SyntheticSoul: Thanks for pointing me to those threads. I'm guessing that at least part of the problem is that the wav file doesn't contain "a number of samples that is evenly divisible by 588, i.e. not a full CD sector."

If I dump the cuesheet block created by metaflac, this is what I get:

CODE
METADATA block #3
 type: 5 (CUESHEET)
 is last: false
 length: 624
 media catalog number:
 lead-in: 0
 is CD: false
 number of tracks: 5
   track[0]
     offset: 0
     number: 1
     ISRC:
     type: AUDIO
     pre-emphasis: false
     number of index points: 1
       index[0]
         offset: 0
         number: 1
   track[1]
     offset: 36691200
     number: 2
     ISRC:
     type: AUDIO
     pre-emphasis: false
     number of index points: 1
       index[0]
         offset: 0
         number: 1
   track[2]
     offset: 74749500
     number: 3
     ISRC:
     type: AUDIO
     pre-emphasis: false
     number of index points: 1
       index[0]
         offset: 0
         number: 1
   track[3]
     offset: 89655300
     number: 4
     ISRC:
     type: AUDIO
     pre-emphasis: false
     number of index points: 1
       index[0]
         offset: 0
         number: 1
   track[4]
     offset: 131470886
     number: 4 (LEAD-OUT)
METADATA block #4
 type: 1 (PADDING)
 is last: true
 length: 7049


Josh (or anyone): See anything wrong with this? Any idea how I can fix this wav file or the cuesheet file?
Synthetic Soul
QUOTE(gharris999 @ Feb 21 2006, 10:50 PM)
The "invalid" ness of the cuesheet specifically has to do with the track index offsets, as far as slimserver is concerned, at least going by the debug messages it spits out with --d_scan.
As I said before, I cannot see how your INDEX statements are invalid, unless your file isn't really at least 33:53 long.

Again though, the fact that we are talking FLAC complicates the issue.
gharris999
I'm sure you are right. When I get some time later this week, I'll bang my head against this issue some more and post my results. Thanks.
jcoalson
I'm not sure I get it... how did the cuesheet get in to the flac file that you showed in your 2nd post? it sounds more like a problem with the slimserver cuesheet parsing.

if you start with the cue-less wave file and do 'metaflac --import-cuesheet-from=file.cue file.flac', does it work? if not, what is the exact message?

also do "metaflac --list --block-type=STREAMINFO"

finally, paste the exact error message from slimserver here.

the rules about sector alignment are only applied when the cuesheet is imported but your cuesheet looks ok (provided the leadout is after the last index point)

Josh

edit: p.s. a valid index point can be MM:SS:FF (frame) and frame must be in [0,74], or a sample number, but the sample number modulo 588 must be 0 if the audio is 44.1kHz/16 or the import will fail with an error. this will become a just warning in the next version of flac/metaflac
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.