The Microsoft Multimedia Control lets you easily determine the total playing time of an Audio CD: you only need to correctly initialize the control and then decipher the value returned by its Length property. Use the following code as a guideline for your routines:
Private Sub cmdDisplayTime_Click()
Dim Value As Integer
Dim TotalTime As String
With MMControl1
' Initialize the Multimedia control
.DeviceType = "CDAudio"
.TimeFormat = 10
.Command = "Open"
' seconds are held in the most significant byte
Value = (.Length \ 256) And 255
TotalTime = Right$("0" & CStr(Value), 2) & """"
' minutes are held in the least significant byte
Value = (.Length And 255) Mod 60
TotalTime = Right$("0" & CStr(Value), 2) & "' " & TotalTime
Value = (.Length And 255) \ 60
If Value > 0 Then
' display hour value only if necessary
TotalTime = CStr(Value) & "h " & TotalTime
End If
MsgBox TotalTime
End With
End Sub