Come calcolare l’id unico che consente di ottenere le informazioni del cd da freecd o simili:
Assumiamo per esempio che il cd da analizzare abbia le seguenti caratteristiche:
# Track frame offsets: # 150 # 15095 # 28530 # 40556 # 60479 # 81952 # 100762 # 112675 # 128656 # 145954 # # Disc length: 2260
10 brani con lunghezza totale di 2.260 secondi: il discid di questo cd sarà 6808d20a , dove (partendo da destra) 0x0a sono i 10 brani del cd; 0x08da sono i 2.260 secondi della lunghezza del CD.
il primo valore corrisponde alla somma dei singoli numeri dell’inizio della traccia / 75… in pratica
| ST | ST/75 | SUM |
| 150 | 2 | 2 |
| 15095 | 201 | 3 |
| 28530 | 380 | 11 |
| 40556 | 540 | 9 |
| 60479 | 806 | 14 |
| 81952 | 1092 | 12 |
| 100762 | 1343 | 11 |
| 112675 | 1502 | 8 |
| 128656 | 1715 | 14 |
| 145954 | 1946 | 20 |
| 104 |
Il valore 104, che è la somma di tutti i valori, deve essere divisa per 255 e prendere il resto: questo in esadecimale è proprio 0x68.
Una volta che si hanno i dati del CD puoi ottenere il resto delle informazioni:
$ telnet freedb.freedb.org 8880 Trying 195.214.216.38... Connected to freedb.freedb.org. Escape character is '^]'. 201 mirror1.freedb.org CDDBP server v1.5.2PL0 ready at Wed Jul 13 16:20:36 2016 cddb hello username hostname clientname version 200 Hello and welcome username@hostname running clientname version. CDDB QUERY f00d0c10 16 150 20972 36331 50117 69524 86255 101371 112896 131608 138844 157390 174137 193697 208667 224774 238280 3342 200 data f00d0c10 Halsey / Badlands CDDB READ data f00d0c10 210 data f00d0c10 CD database entry follows (until terminating `.') # xmcd # # Track frame offsets: # 150 # 20972 # 36331 # 50117 # 69524 # 86255 # 101371 # 112896 # 131608 # 138844 # 157390 # 174137 # 193697 # 208667 # 224774 # 238280 # # Disc length: 3342 seconds # # Revision: 0 # Processed by: cddbd v1.5.2PL0 Copyright (c) Steve Scherf et al. # Submitted via: ExactAudioCopyFreeDBPlugin 1.0 # DISCID=f00d0c10 DTITLE=Halsey / Badlands TTITLE0=Castle TTITLE1=Hold Me Down TTITLE2=New Americana TTITLE3=Drive TTITLE4=Hurricane TTITLE5=Roman Holiday TTITLE6=Ghost TTITLE7=Colors TTITLE8=Colors Pt. II TTITLE9=Strange Love TTITLE10=Coming Down TTITLE11=Haunting TTITLE12=Gasoline TTITLE13=Control TTITLE14=Young God TTITLE15=I Walk The Line EXTD= EXTT0= EXTT1= EXTT2= EXTT3= EXTT4= EXTT5= EXTT6= EXTT7= EXTT8= EXTT9= EXTT10= EXTT11= EXTT12= EXTT13= EXTT14= EXTT15= PLAYORDER=
ed il gioco è fatto !!
