how do i play .wav files in VB.Net?

  • Thread starter Thread starter garyK
  • Start date Start date
G

garyK

i would like play some short wav files in my VB.net program, how would i do this?

thanks

gary
 
Hi Gary,

Add this you your form in the declarations section just above the load
event:
Private Declare Function PlaySound _

Lib "WINMM.DLL" Alias "sndPlaySoundA" _

(ByVal lpszSoundName As String, _

ByVal uFlags As Long) As Long

Private Enum playsoundflags

async = &H1

sync = &H0

End Enum

Then call it in whatever event you wish to call it, like this:

PlaySound("c:\mymedia\testwav.wav", playsoundflags.async)

HTH,

Bernie Yaeger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Convert WAV to MP3 4
Play Wav File In vb.net 2
audio problem 2
playing & re-playing 7 .wav files 2
what to use to play sound? 5
Convert WAV to MP3 1
Playing Sound Files 4
Reference Embedded WAV file 1

Back
Top