473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 3088
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

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

Similar topics

6
by: Andrew Poulos | last post by:
As a follow on to the 'fun' I had with IE I'm now trying to play sounds using an Object tag (no Embed) in MZ. Sadly whenever 'playButton' gets clicked MZ says that "audObj.Play is not a function":...
1
by: Ron Provost | last post by:
Hello, I'm developing a piece of software to assist illiteraate adults to learn to read. I'm trying to figure out how, if possible, to make audio playback asynchrnous but still controllable. ...
1
by: Lord2702 | last post by:
I want to play a sound file, which is on my server, and approximately 5 - 7 MB it is .Wav file. or .mp3, I want to play this file so that user of my site can click on a link to play this file. Is...
1
by: Lam | last post by:
how can I play sound file in a .aspx page written in C#? I try to use the code like the following. But whenI call the play function play("sound.wav", this.SND_ASYNC) my computer give out "be"...
9
by: Morris Neuman | last post by:
Im working with VS 2005 and trying to use a Hyperlink field in a datagrid to play a wave file that is not located in the website folders but is in a plain folder on the same machine, windows 2003...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
1
by: microteq | last post by:
Hello, I am trying to play a file from my ASP.NET application on the client's browser using a link like: <a href="../sounds/21.wav">Play</a> When I click the link, WMP opens and I get the...
5
by: | last post by:
Hello, I am wrtting a program that does some sound effects... the files are stored in a subfolder in the application folder... and I check the existence of the files before calling the method to...
26
by: Jake Barnes | last post by:
I did a search on the newsgroup comp.lang.javascript. I was searching for "how to play a sound with Javascript". I'm somewhat suprised that the majority of entries are from the 1990s, and there are...
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.