Results 1 to 2 of 2

Thread: Get informations about a inserted CD?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Posts
    3

    Post

    I just need help with an old and big problem!

    I need to know how to get informations about
    a inserted CD in my cd-rom drive. I need to know what typ of cd-track (data or audio track) is used, i must detect the correct lenght of these tracks, etc. pp.

    I also allready checked many source libraries, wrote to software companys which sell recording software, etc. but got no informations/help. I posted allready two times in here about this problem, but i got
    no help, yet. PLEASE, HELP ME! (If you can!)

  2. #2
    Addicted Member Razzle's Avatar
    Join Date
    Jan 2000
    Location
    Berlin, Germany
    Posts
    161

    Post

    Private Declare Function mciGetErrorString Lib "winmm.dll" Alias "mciGetErrorStringA" (ByVal dwError As Long, ByVal lpstrBuffer As String, ByVal uLength As Long) As Long
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

    Static s as String * 30
    Dim numTracks as Integer
    Dim tracklength()$


    'number of tracks:
    mciSendString "status cd number of tracks wait", s, Len(s), 0
    numTracks = CInt(Mid$(s, 1, 2))

    'check if audio cd:
    'if cd has only 1 track the it should be an audio cd.
    if (numTracks = 1) Then Exit Sub

    'length of CD:
    mciSendString "status cd length wait", s, Len(s), 0
    ' number of tracks is numTracks
    Redim tracklength(1 To numTracks)
    Dim i as Integer
    For i = 1 To numTracks
    cmd = "status cd length track " & i
    mciSendString cmd, s, Len(s), 0
    trackLength(i) = s
    Next i
    SendMCIstring "seek cd to 1", True

    Private Function SendMCIString(cmd As String, showError As Boolean) As Boolean
    Static rc As Long
    Static errStr As String * 200
    rc = mciSendString(cmd, 0, 0, hWnd)
    If (showError And rc <> 0) Then
    mciGetErrorString rc, errStr, Len(errStr)
    MsgBox errStr
    End If
    SendMCIString = (rc = 0)
    End Function


    For more questions concerning this, I could send you a sample of a cdplayer. Just ask


    ------------------
    Razzle
    ICQ#: 31429438

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width