CD player : how to know which CD..... 
Author Message
 CD player : how to know which CD.....


->I'm just trying to make a CD player like the one which comes
->with WIN95. How do I get an unique identifier of the CD?
->In cdplayer.ini where WIN95 keeps the names and number of tracks,
->there is a [24323] on top of every entry.
->
->If someone know how to get this number from the CD I would be
->extremly happy.

There are a couple of problems here and they are probably the reason
why there is no direct API function call that will do this.

First, not all manufacturers place a unique identifier on their CDs.
Second, not all follow the standard volume label format. As a result
the only way to do this is through a direct call to the CD Rom driver,
which I don't believe is possible with VB.

On the other hand you can always create your own using code such as
this:

   Dim DiskID As Long
   Dim Track As Integer

   ' Initialize CD:
   mmcontrol1.DeviceType = "CDAudio"
   mmcontrol1.Command = "open"

   ' Make unique number based on tracks and tracklength:
   DiskID = mmcontrol1.Tracks
   For Track = 1 To mmcontrol1.Tracks
        mmcontrol1.Track = Track
        DiskID = DiskID + mmcontrol1.TrackLength  ' Add 4-byte
TrackLength
         DiskID = DiskID + mmcontrol1.Length       ' Add 4-byte CD
Length
   Next Track

   ' Set text to unique value:
   Text1.Text = DiskID

Paul
~~~~



Mon, 16 Aug 1999 03:00:00 GMT  
 CD player : how to know which CD.....

Try this: (version 0.1 without errors verifications...)

Function CDAID() As String
    Dim st1 As String * 4
    Dim g As String
    Open "f:\track01.cda" For Random As #1 Len = 4
        'Change 'f:' with your cdrom letter
    Get #1, 7, st1
    Close
    For f = 1 To 4
        g = Right$("0" + Hex$(Asc(Mid$(st1, f, 1))), 2) + g
    Next
    CDAID = Trim$(Str$(Val(g)))
End Function



Quote:
> I'm just trying to make a CD player like the one which comes
> with WIN95. How do I get an unique identifier of the CD?
> In cdplayer.ini where WIN95 keeps the names and number of tracks,
> there is a [24323] on top of every entry.

> If someone know how to get this number from the CD I would be
> extremly happy.



Wed, 18 Aug 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. cd player writing on cd-rom??????

2. VB CD Player/CD Database Program

3. CD Player Example - CD.zip (0/1)

4. CD-Audio Player with multiple CD-ROMS...

5. Automate load CD player and play cd?

6. CD door open and close with 2 cd players

7. help w/ cd-rom and cd-r/cd-rw program, please

8. no sound from cd-player

9. CD-Player

10. CD player for Qbasic

11. MS deluxe cd player questions

12. Help making a CD player!

 

 
Powered by phpBB® Forum Software