24 May '13 - 23:23 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Reading CD track information  (Read 690 times)
Graham1
Posts: 35


« on: 24 May '12 - 13:52 »
Reply with quoteQuote


Using the default settings I call this:

    cd_read := BASS_CD_GetID(rip_cd_drive_selection, BASS_CDID_CDDB_READ);

Usually it returns a string from which I can extract the CD artist/album and track information. However some CDs return an empy string. In this case is there alternative I can try?

Regards
Graham
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #1 on: 24 May '12 - 15:12 »
Reply with quoteQuote

To confirm whether your CD is in the FreeDB database, you can get the BASS_CDID_CDDB id and enter the first 8 characters into this form:

   www.freedb.org/freedb_discid_check.php

If the CD is in the database, to check whether the problem may be something specific to your code, please see if you can reproduce it with the pre-compiled CDTEST.EXE example (in C\BIN), ie. do you see title info when enabling the "Get titles from FreeDB" option?
Logged
Graham1
Posts: 35


« Reply #2 on: 24 May '12 - 17:26 »
Reply with quoteQuote

It would appear that there is more than one type of CD. Your CD test program does indeed correctly display the track names. However it does not display the names from all of my other CDs. So it would appear that soemthing like this is required:

  cdtext := BASS_CD_GetID(rip_cd_drive_selection, BASS_CDID_CDDB_READ); //get any info from some IP address on the Internet

  if cdtext contains no information then
    cdtext := BASS_CD_GetID(rip_cd_drive_selection, BASS_CDID_TEXT); //I assume this gets any info from the CD itself.

Graham
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #3 on: 25 May '12 - 12:50 »
Reply with quoteQuote

BASS_CDID_TEXT gives CD-TEXT information, which is indeed read from the CD (rather than a database). Please see the BASS_CD_GetID documentation for details on that.

From what you say, it sounds like you tried the Delphi version of the CDTEST example? That hasn't been updated to check CDDB info, which would explain why you didn't see titles for your other CDs. You could take a look at the C version of the CDTEST example, which does first check for CDDB info (when enabled) before CD-TEXT info. The BASS/CD calls are much the same in any language, so even though it isn't Delphi, it will hopefully give you an idea of what to do in your own code.
Logged
Graham1
Posts: 35


« Reply #4 on: 25 May '12 - 13:30 »
Reply with quoteQuote

I have now successfully modified my code so that it first checks the internet database. If that fails it reads any data from the CD itself.
I now have CD that fails both of these methods. However Media Player is able to display Artist, Album and track information. And it appears to do it without the use of the internet. This suggests to me that there is another format in which data can be stored on the CD.

I am investigating.

Graham
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #5 on: 28 May '12 - 15:56 »
Reply with quoteQuote

Windows Media Player uses a different CD database, so it may be that that database includes your CD while the FreeDB database doesn't (you can use the form linked above to confirm whether that is so). You could also try switching to the MusicBrainz database, like this:

BASS_SetConfigPtr(BASS_CONFIG_CD_CDDB_SERVER, "freedb.musicbrainz.org");
Logged
Graham1
Posts: 35


« Reply #6 on: 29 May '12 - 11:16 »
Reply with quoteQuote

The Disk ID for the CD in question is E2110011.
The Artist is: Treebeard
Album name: Heavy Wood

Using the link in a previous post, this returns the data for some other CD.  BASS_CD_GetID returns nothing. If I change the server to:

BASS_SetConfigPtr(BASS_CONFIG_CD_CDDB_SERVER, PChar('freedb.musicbrainz.org'));

Now I get some data, but it's not the correct CD.

Is this the point at which we bow to the superiour knowledge of Microsoft?

Graham
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #7 on: 29 May '12 - 13:23 »
Reply with quoteQuote

It looks like your CD is in the FreeDB database with a different ID (e9114611). It sometimes happens that there are multiple versions of a CD with slightly different track layouts (that is what the ID is based on).

Regarding Microsoft/WMP, I believe they use the Allmusic database. That isn't free, so you would need to pay some fees if you want to use that in your software.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines