Link to home
Start Free TrialLog in
Avatar of poorboy
poorboy

asked on

get title from cdaudio

Using VB5, is there a way to get the title of the current song being played on a audio cd? I have made a cd player and i would like to add this feature to it. Can this be done or do i have to make a play list?
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

ASKER CERTIFIED SOLUTION
Avatar of paulstamp
paulstamp

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cloudjin
Cloudjin

There are two ways to get this information.

1. If the information is already stored in the cdplayer.ini file.

Read the *.cda files on the CD, and retrieve the CD id from bytes 25->28. This CD id will match the cdplayer.ini section name. Here you will find the title, artist, etc..

2. If the information is not available on your machine, you'll need to use CDDB to retrieve the information. Look at http://www.cddb.com for information and samples.

And to clearify a point, CD titles are NOT stored on the CD's.
The cdplayer.ini file can only return information the user has typed in... it will not retrieve the name of a track from a CD directly which I believe is what poorboy is asking.
A lot of programs store the CDDB information in the CDPlayer.ini file.

Hence, it can be used as a resource. (This was intended as an easy solution, as well as pointer to the files purpose).

However, the CDDB support will be the optimal solution. And considering that CDDB2 offers a COM-based API for windows platforms, it shouldn't be much problems to implement it :)

Full samples, and the ActiveX kit, are available at www.cddb.com. You'll need to sign an agreement first though :)
Avatar of poorboy

ASKER

Thanks to all for your help. I'll try to use the CD Serial Number to create a playlist.