How do you play sound files in Visual Basic 2005? I have been trying to do it with the Windows Media component. Is this the right tool for the job?
Playing Sounds in VB 2005
Collapse
X
-
Did it work for you?Originally posted by TNTHow do you play sound files in Visual Basic 2005? I have been trying to do it with the Windows Media component. Is this the right tool for the job? -
in vb6 u've to use one api playsoundOriginally posted by TNTHow do you play sound files in Visual Basic 2005? I have been trying to do it with the Windows Media component. Is this the right tool for the job?Comment
-
The question is about visual basic 2005. Not vb6Originally posted by vijaydiwakarin vb6 u've to use one api playsoundComment
-
k........ coolOriginally posted by willakawillThe question is about visual basic 2005. Not vb6
I'll try to solve itComment
-
Search for API guid. this guid contains all API's along with examples in vb and .net also. This guid is by kpdteamOriginally posted by TNTHow do you play sound files in Visual Basic 2005? I have been trying to do it with the Windows Media component. Is this the right tool for the job?Comment
-
Hi there,Originally posted by TNTHow do you play sound files in Visual Basic 2005? I have been trying to do it with the Windows Media component. Is this the right tool for the job?
Kindly refer to below code segment, hope it helps. Good luck & Take care.
Declarations:
Code:Code:Private Declare Auto Function PlaySound Lib "winmm.dll" _ (ByVal lpszSoundName As String, ByVal hModule As Integer, _ ByVal dwFlags As Integer) As Integer Private Const SND_FILENAME As Integer = &H20000
Code:Public Function PlayWav(ByVal fileFullPath As String) _ As Boolean 'return true if successful, false if otherwise Dim bAns As Boolean, iRet As Integer = 0 Try iRet = PlaySound(fileFullPath, 0, SND_FILENAME) Catch End Try Return iRet End FunctionComment
Comment