Note that if you want to play wave files from resources, you should do :
Public Const SND_MEMORY = &H4
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA"
(lpszSoundName as Any, ByVal uFlags As Long) As Long
then... (to play resource ID 2000)
Dim data() as Byte
data = LoadResData( "2000", "WAVE")
retval = sndPlaySound( Data(0), SND_MEMORY)
Using the SND_RESOURCE flag didn't seem to work in VB no matter which way i
declared the function...
Quote:
>Include the following lines in the declarations of your module:
>Public Const SND_ASYNC = &H1
>Public Const SND_SYNC = &H0
>Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA"
>(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
>Then, simply call the function:
>lRes = sndPlaySound( "c:\Media\SomeWave.Wav",SND_ASYNC)
>That's all there is to it.
>Use SND_ASYNC as the second parameter if you want the function to return
>control as soon as it starts playing the WAV file; or SND_SYNC if you only
>want control back once the WAV file has been played completely.
>Hope this helps,
>Fil
>> How can i play a wav file in visual basic ?
>> Please help me...