i need to find a Simple way of playing audio on a form, how can this be done.......please help...i'll be playing a .wav file which will be very short like saying the word "help". thanks
Printable View
i need to find a Simple way of playing audio on a form, how can this be done.......please help...i'll be playing a .wav file which will be very short like saying the word "help". thanks
Do a search on this forum for "PlaySound", it's been answered many times before :)
you the man!
Use the PlaySound API function.
Best regardsCode:Private Declare Function PlaySound _
Lib "winmm.dll" Alias "PlaySoundA" ( _
ByVal lpszName As String, _
ByVal hModule As Long, _
ByVal dwFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Const SND_FILENAME = &H20000
Public Sub PlayItSam(FileName As String)
PlaySound FileName, 0, SND_ASYNC + SND_FILENAME
End Sub
Public Sub StopThatNoice()
PlaySound vbNullString, 0, SND_ASYNC
End Sub