Sunday, June 28, 2009

Play wav file at VB6

This source for play wav file on vb6. First create new module or insert this code to your module:


Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName as String, ByVal uFlags as Long) as Long

Private Sub PlayWav(ByVal Filename As String)
sndPlay=sndPlaySound(Filename, 1)
End Sub



Example to play wav file:
Call PlayWav("C:mywav.wav")


No comments:

Post a Comment