Easiest way to play an MP3 when a form loads?

  • Thread starter Thread starter Patrick
  • Start date Start date
P

Patrick

Hello - I'm pretty new to VB, and have a tiny project going outside of class
to keep my brain moving. I would like to spice up a program so that on the
form load, it will play a MP3 in the background - nothing overbearing, just
a quiet something.

Another thing I would like to do is have the buttons click, you know, make a
click noise when you press them - I have the perfect sound in .wav format
("click.wav"), and it's only 6k.

I have started looking into winmm.dll, but everything I find on the net is
for VB 6 or earlier - I'm only using VB .net.

Thanks for any help anyone can provide, as I want to show my wife that I'm
learning something fun as well as interesting.
 
Ok - Figured out the .wav file thing, by inlcuding

Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
' and to following as part of the event

sndPlaySound("c:\temp\click.wav", &H1)

' H0 means stop to play, H1 means play and continue processing

Now to figure out the MP3 portion - hmmm....
 

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

Back
Top