Option Explicit
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Enum SoundOption
SND_SYNC = &H0
SND_ASYNC = &H1
SND_NODEFAULT = &H2
SND_LOOP = &H8
SND_NOSTOP = &H10
End Enum
Public Sub PlaySound(Filename As String, Optional OpsiSound As SoundOption = SND_ASYNC Or SND_NODEFAULT)
Dim sThewavsound As String, ret As Long
sThewavsound = Filename
ret = sndPlaySound(sThewavsound, OpsiSound)
End Sub
Contoh Penggunaan fungsi menjalankan file .wav menggunakan visual basic 6.0
Private Sub Command1_Click()
PlaySound Text1.Text, SND_ASYNC
End Sub
Sunday, May 27, 2012
Fungsi Untuk Menjalankan File .wav Menggunakan Visual Basic 6.0
Labels:
Multimedia