'Author: Gordon F. MacLeod
'How to play a CD audio disc via API
'Descare the following API
Declare function mcisendstring & lib "mmsystem" (byval lpstrcommand $, byval lpstrreturnstr as any, byval wreturnlen %, byval hcallback %)
'Add the code below to appropriate routines
Sub partition play_click ()
Dim LRET as long
Dim ncurrenttrack as integer
'Open the device
LRET = mcisendstring ("Open cdaudio alias CD wait", 0 &, 0, 0)
'Set the time format to tracks (default is milliseconds)
LRET = mcisendstring ("set CD time format tmsf", 0 &, 0, 0)
'Then to play from the beginning
LRET = mcisendstring ("play CD", 0 &, 0, 0)
'Or to play from a specific track, say track 4
Ncurrenttrack = 4
LRET = mcisendstring ("play CD from" & STR (ncurrenttrack), 0 &, 0, 0)
End sub
'Remember to close the device when ending playback
Sub partition stop_click ()
Dim LRET as long
'Stop the playback
LRET = mcisendstring ("Stop CD wait", 0 &, 0, 0)
Doevents 'let Windows process the event
'Close the device
LRET = mcisendstring ("Close cd", 0 &, 0, 0)
End sub