469,621 Members | 1,740 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,621 developers. It's quick & easy.

Play a wav file.

Hi, I am looking to play a wave file in visual basic. I would like it to play from the resource file. I have added the wave file but how do I get it to play? I do have this code.

Expand|Select|Wrap|Line Numbers
  1. Dim Sound As New System.Media.SoundPlayer()
  2.  
  3. Sound.SoundLocation = “your path to the .wav file” ‘ex.: c:\mysound.wav
  4. Sound.Load()
  5. Sound.Play()
Thanks
May 28 '07 #1
4 2784
debasisdas
8,127 Expert 4TB
try using the system API ----- PlaySound
May 28 '07 #2
Killer42
8,435 Expert 8TB
Hi, I am looking to play a wave file in visual basic. I would like it to play from the resource file. I have added the wave file but how do I get it to play?
Can you explain what you mean by "the resource file", to make sure we're all on the same "wavelength"? The code you posted looks as though it's intended to play directly from the WAV file, not from a resource file.
May 28 '07 #3
Can you explain what you mean by "the resource file", to make sure we're all on the same "wavelength"? The code you posted looks as though it's intended to play directly from the WAV file, not from a resource file.
I understand this but the resource file that is in VB is were I would like to play my sound from. The code I posted is for a file name but I want one that will play a sound in the resource file.
May 28 '07 #4
Killer42
8,435 Expert 8TB
I understand this but the resource file that is in VB is were I would like to play my sound from. The code I posted is for a file name but I want one that will play a sound in the resource file.
In that case, I think you had better tell us what version of VB you're using.

Also, here's a Google search which may help.
May 28 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Andrew Poulos | last post: by
1 post views Thread by Ron Provost | last post: by
1 post views Thread by Lord2702 | last post: by
1 post views Thread by Lam | last post: by
1 post views Thread by microteq | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.