The code below shows you how to play a WAV sound file (with the extension wav)
Public Declare Function playa Lib "winmm.dll" Alias "sndPlaySoundA"
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Sub PlayWav(sFile As String)
If Dir(sFile$) <> "" Then Call playa(sFile,
SND_FLAG)
End Sub
So, to play a file using this code, enter the following:
'// plays C:\west.wav
Call PlayWav("C:\west.wav")
Comments