Click to See Complete Forum and Search --> : How to Use micSendString?


December 16th, 1999, 10:49 AM
I use this :
dim R as integer
R=micSendString("OPEN c:\abc.mid TYPE sequencer alias abc", 0&, 0, 0) or
R=micSendString("OPEN c:\abc.wav TYPE waveaudio alias abc", 0&, 0, 0) then right,but I use like this then wrong:
dim strCmd as string
strcmd="OPEN " & filename & " TYPE " & micType * " alias abc "
R=micSendString(strCmd, 0&, 0, 0 ) is no mid or Cd or Wav Play,why?

December 18th, 1999, 04:53 AM
let's put this in a class module and you'll get something like this:
public lReturn as long
Public sub mmOpen(byval TheFile as string)
dim sType as string, sAlias as String
'determine which type it is
Select Case Ucase$(Right$(TheFile,3))
Case "WAV"
sType= "Waveaudio"
Case "MID"
sType = "AviVideo"
...
End Select
sAlias = Right(TheFile,3) & Minute(now) 'create unique alias

lReturn = mciSendString("OPEN" & TheFile & " ALIAS " & sAlias _
& " TYPE" & sType & " wait", "",0,0)
End Sub

Public Sub mmPlay()
if sAlias = "" then exit sub
nReturn= mciSendstring("PLAY " & sAlias,"",0,0)
End Sub