I've figured out how to play sound through windows media player within a form, but i don't know how to send sound directly to the sound driver. If anybody knows, please tell me.
thnx
Printable View
I've figured out how to play sound through windows media player within a form, but i don't know how to send sound directly to the sound driver. If anybody knows, please tell me.
thnx
Type this in a moduel:
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As Any, ByVal uFlags As Long) As Long
Const SND_ASYNC = &H1
Then, in your form. When ever something happens type this:
sndPlaySound App.Path & "\nameofsoundfile.wav", &H1
Hope this helps!
If you wish for program execution to cease, add SND_SYNC from the constants section of the API viewer and use that for your flag.
thanks,
it works for me