home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Eagles Nest BBS 6
/
Eagles_Nest_Mac_Collection_Disc_6.TOAST
/
Windows
/
VisBasAPIex
/
VBAPIGUIDE.image
/
MMTEST.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-10-11
|
971b
|
43 lines
Option Explicit
'
' This function plays a WAV sound file
'
Function PlayWAV$ (wavename$)
Dim e$, e2$
e$ = SendMMString$("Open " + wavename$)
If e$ <> "" Then
PlayWAV$ = e$
Exit Function
End If
e$ = SendMMString$("Play " + wavename$ + " wait")
e2$ = SendMMString$("Close " + wavename$)
PlayWAV$ = e$ & e2$
End Function
'
' This function sends multimedia string messages
'
Function SendMMString$ (cmdstring$)
Dim res%
Dim errstring As String * 128
res% = mciSendStringAny&(cmdstring$, 0&, 0, 0)
' On success, just return an empty string
If res% = 0 Then
SendMMString$ = ""
Exit Function
End If
' On error, return the error description
res% = mciGetErrorString(res%, errstring, Len(errstring) - 1)
If res% <> 0 Then
SendMMString$ = errstring
Else
SendMMString$ = "Unknown error"
End If
End Function