How do I play a sound file in my program??
Simple I am sure...
Please be detailed...
Thanks,
Anjari
Printable View
How do I play a sound file in my program??
Simple I am sure...
Please be detailed...
Thanks,
Anjari
Through COM Interop, you could use the windows media player ocx component.
Hehe please explain a little more..
Anjari
Right Click the toolbox and select cosomize toolbox.
Click on the Com Components tab and scroll down to the bottom were it says "Windows Media Player".
Click the check box beside it and click ok.
At the bottom of the toolbox their sould now be the Windows Media Player control.
API will work too:
VB Code:
Private Declare Auto Function PlaySound Lib "winmm.dll" (ByVal ByVallpszSoundName As String, ByVal hModule As Integer, ByVal dwFlags As Integer) As Integer SUB...etc Dim pathtofile As String = "c:\test.wav" Dim fileName As String = String.Concat(pathtofile) Const SND_FILENAME As Integer = &H20000 PlaySound(fileName, 0, SND_FILENAME) end sub