PDA

View Full Version : FLAC & Ogg Vorbis Storage of CDTOC



Spoon
04-03-2008, 08:28 AM
We have been asked over and over again by individuals / companies to offer storage of a CD TOC (table of contents from Audio CD) in Vorbis Comments, as no standard was forthcoming we have acted in creating a new standard:

Tag Name:

CDTOC

Table of contents stored as a string made up from:

[audio trackcount]+[first audio track address]+[second audio track address]....

Track addresses are stored (LBA Address + 150), that is 2 seconds in for the first track.

Special cases:

CD Extra discs: the lead out address is added to the end, track count is still just for audio tracks.
[data][audio] discs: as a normal CD, except on the end is +X[LBA of Data Track + 150]

Example of ordinary Audio CD:


LBA FirstIndex: 1 last Index: 10
Type: Audio Track 1 LBA Address: 0 Length: 00:04:08.733
Type: Audio Track 2 LBA Address: 18655 Length: 00:04:34.760
Type: Audio Track 3 LBA Address: 39262 Length: 00:04:19.573
Type: Audio Track 4 LBA Address: 58730 Length: 00:04:14.867
Type: Audio Track 5 LBA Address: 77845 Length: 00:03:27.960
Type: Audio Track 6 LBA Address: 93442 Length: 00:03:09.867
Type: Audio Track 7 LBA Address: 107682 Length: 00:04:02.466
Type: Audio Track 8 LBA Address: 125867 Length: 00:03:44.040
Type: Audio Track 9 LBA Address: 142670 Length: 00:04:04.334
Type: Audio Track 10 LBA Address: 160995 Length: 00:04:37.666
Type: Lead Out LBA Address: 181820

ID Tag CDTOC=A+96+4975+99F4+E600+130AB+16D98+1A538+1EC41+ 22DE4+27579+2C6D2



Example of CD with Hidden First Track:


LBA FirstIndex: 1 last Index: 10
Type: Audio Track 1 LBA Address: 8925 Length: 00:05:35.266
Type: Audio Track 2 LBA Address: 34070 Length: 00:04:25.667
Type: Audio Track 3 LBA Address: 53995 Length: 00:04:37.267
Type: Audio Track 4 LBA Address: 74790 Length: 00:03:03.800
Type: Audio Track 5 LBA Address: 88575 Length: 00:04:23.533
Type: Audio Track 6 LBA Address: 108340 Length: 00:05:59.733
Type: Audio Track 7 LBA Address: 135320 Length: 00:04:14.627
Type: Audio Track 8 LBA Address: 154417 Length: 00:04:05.533
Type: Audio Track 9 LBA Address: 172832 Length: 00:05:15.374
Type: Audio Track 10 LBA Address: 196485 Length: 00:08:58.200
Type: Lead Out LBA Address: 236850

ID Tag CDTOC=A+2373+85AC+D381+124BC+15A95+1A7CA+2112E+25B C7+2A3B6+3001B+39DC8


Special Case 1, Example of CD Extra CD:


LBA FirstIndex: 1 last Index: 14
Type: Audio Track 1 LBA Address: 0 Length: 00:04:10.413
Type: Audio Track 2 LBA Address: 18781 Length: 00:03:39.093
Type: Audio Track 3 LBA Address: 35213 Length: 00:03:11.534
Type: Audio Track 4 LBA Address: 49578 Length: 00:04:03.426
Type: Audio Track 5 LBA Address: 67835 Length: 00:03:36.894
Type: Audio Track 6 LBA Address: 84102 Length: 00:03:59.080
Type: Audio Track 7 LBA Address: 102033 Length: 00:04:21.773
Type: Audio Track 8 LBA Address: 121666 Length: 00:03:21.227
Type: Audio Track 9 LBA Address: 136758 Length: 00:03:56.213
Type: Audio Track 10 LBA Address: 154474 Length: 00:04:35.240
Type: Audio Track 11 LBA Address: 175117 Length: 00:04:04.000
Type: Audio Track 12 LBA Address: 193417 Length: 00:04:09.947
Type: Audio Track 13 LBA Address: 212163 Length: 00:03:57.160
Type: Data Track 14 LBA Address: 229950 Length: 00:11:27.480
Type: Lead Out LBA Address: 281511

ID Tag CDTOC=D+96+49F3+8A23+C240+10991+1491C+18F27+1DBD8+ 216CC+25C00+2ACA3+2F41F+33D59+382D4+44C3D

Notice the +44C3D is the lead out and track count of 13 (even though with last data track there are 14 tracks, so the track starting at 382D4 is a Data track)


Special Case 2, Example of [data][audio] CD:




LBA FirstIndex: 1 last Index: 12
Type: Data Track 1 LBA Address: 0 Length: 00:08:11.386
Type: Audio Track 2 LBA Address: 36854 Length: 00:05:53.000
Type: Audio Track 3 LBA Address: 63329 Length: 00:04:29.880
Type: Audio Track 4 LBA Address: 83570 Length: 00:05:33.494
Type: Audio Track 5 LBA Address: 108582 Length: 00:05:21.653
Type: Audio Track 6 LBA Address: 132706 Length: 00:06:07.307
Type: Audio Track 7 LBA Address: 160254 Length: 00:04:41.693
Type: Audio Track 8 LBA Address: 181381 Length: 00:04:50.733
Type: Audio Track 9 LBA Address: 203186 Length: 00:06:08.307
Type: Audio Track 10 LBA Address: 230809 Length: 00:04:41.360
Type: Audio Track 11 LBA Address: 251911 Length: 00:06:14.667
Type: Audio Track 12 LBA Address: 280011 Length: 00:05:14.813
Type: Lead Out LBA Address: 303622

CDTOC=B+908C+F7F7+14708+1A8BC+206F8+27294+2C51B+31 A48+3862F+3D89D+44661+4A29C+X96

Here the data track is signalled by +X96, which is 96 in Hex (the LBA start address, of 150)


Incidently this tag is exactly the same as the WM/MCID tag in .wma (as created by Windows Media Player), or the ITOC tag of a Wave LIST tag, EXCEPT for the special cases listed above.

EliC
04-03-2008, 09:12 AM
Spoon, thank you for addressing this. I certainly am no expert on this so I will simply repost Skamp's questions:

http://www.hydrogenaudio.org/forums/index.php?showtopic=59685*


Now, I'd like to know how we're supposed to compute FreeDB DiscIDs without a lead-out address? Without first and last track numbers, how are we supposed to compute MusicBrainz DiscIDs? How are we supposed to handle discs with a data track as track 01? Discs with negative LBAs?

Do we need some more before this is final?

EliC
04-03-2008, 09:17 AM
Incidently this tag is exactly the same as the WM/MCID tag in .wma (as created by Windows Media Player), or the ITOC tag of a Wave LIST tag.

Do we need an extended CD TOC (CDTOC+) to cover these extra issues. So we could have two tag fields, one that is consistent with WMP and one that includes the extra info.

Spoon
04-03-2008, 11:17 AM
This thread is about FLAC and Ogg CD TOC, existing WMA and Wave tags are not included.

EliC
04-03-2008, 11:35 AM
This thread is about FLAC and Ogg CD TOC, existing WMA and Wave tags are not included.

I know. My reference to WMP was related the FLAC specs you introduced being consistent with the current MS implementation, which I thought was one of your goals.

Porcus
04-30-2008, 07:28 AM
Are there other bits that could be considered -- like CD-Text, or Pre-Emphasis or HDCD?

(Pardon my ignorance.)

Spoon
04-30-2008, 09:09 AM
CD Text is saved in ID Tags, HDCD should be diecoded to 24 bit on ripping, Pre-Emph should also have the de-emph applied on ripping.

Porcus
05-02-2008, 09:41 AM
Pre-Emph should also have the de-emph applied on ripping.

E.T.A. in dBpoweramp? ;-)

Spoon
05-02-2008, 02:37 PM
A while (it has missed R13).

Porcus
03-09-2011, 06:30 PM
Bumping an old thread I know, but: This TOC is incomplete as far as index points go. Is that the only information missing compared e.g. to a cuesheet?

Spoon
03-10-2011, 02:36 AM
Index points are not in the TOC, they are subchannel.

EliC
03-19-2011, 12:46 PM
Pre-Emph should also have the de-emph applied on ripping.

want to echo porcus' question above, will dBpoweramp soon set a flag for this or de-emph at ripping?

Spoon
03-22-2011, 02:58 AM
>will dBpoweramp soon set a flag for this or de-emph at ripping?

I will add as a wish request for r14.2

Acuna
03-14-2014, 12:34 PM
Hello!

Can I ask you what program create this data? I want to get the text file with it.

I'm using cdrdao read-toc command, but it write looks like this:


CD_DA


// Track 1
TRACK AUDIO
NO COPY
NO PRE_EMPHASIS
TWO_CHANNEL_AUDIO
FILE "data.wav" 0 09:24:30


// Track 2
TRACK AUDIO
NO COPY
NO PRE_EMPHASIS
TWO_CHANNEL_AUDIO
FILE "data.wav" 09:24:30 05:42:43

It's good, but I want more detailed information, looks like cdrdao's cmd echo text. I tried to write its result in file, but it's empy(

Thanks!

Spoon
03-14-2014, 12:53 PM
dBpoweramp writes this information.

Acuna
03-14-2014, 01:04 PM
Thanks! But I'm using my own console CD checker (I like simple progs :) ) and it's important for me that it'll working in command prompt...