When I click a button I would like it to make a certain sound, and how do I "import this sound from a file? And not just the lame "beep()" sound either
Printable View
When I click a button I would like it to make a certain sound, and how do I "import this sound from a file? And not just the lame "beep()" sound either
The framework doesn't support sound yet, you'll have to use interop/pinvoke.
this little API works fine :
VB Code:
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Integer, ByVal dwFlags As Integer) As Integer Private Const SND_FILENAME As Integer = &H20000 ' name is a file name Private Const SND_ASYNC As Short = &H1S ' play asynchronously Private Const SND_SYNC As Short = &H0S Private Const path As String = "specify the path here" 'then call as follow : PlaySound(path & "\wavsound.wav", 0, SND_SYNC)