473,386 Members | 1,860 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.

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

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

thanks

gary
Nov 20 '05 #1
2 1180
* ga*****@yahoo.com (garyK) scripsit:
i would like play some short wav files in my VB.net program, how would i do this?


<http://www.google.de/groups?selm=exQuKMjfDHA.1712%40TK2MSFTNGP11.phx.gb l>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
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

"garyK" <ga*****@yahoo.com> wrote in message
news:91**************************@posting.google.c om...
i would like play some short wav files in my VB.net program, how would i do this?
thanks

gary

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: MLH | last post by:
I have some audio help files that play fine from within Access 97 and Access 2.0. Both are running on a Windows XP box. But I do not know what program plays the files. If I click Start, Run and...
2
by: johnmmcparland | last post by:
I recently came across some code to help play .wav; http://www.codeguru.com/Csharp/Csharp/cs_graphics/sound/article.php/c6143/ and while I got this to work in a stand-alone application, I have...
5
by: djc | last post by:
what choices do I have to play sounds in a program using vb.net? Or, I guess if nothing vb specific what windows API(s) should I look at? I am interested to find out whats needed for playing short...
20
by: Stephen Kellett | last post by:
Hi Folks, How can I play midi and/or audio files using JavaScript? I'm hoping there are some calls/APIs I can use that I am unaware of. My JavaScript book from O'Reilly seems rather lacking in...
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,...
6
by: =?Utf-8?B?SmF3YWhhcg==?= | last post by:
I need to play .vox files using ASP. Can anyone help me out.
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: 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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.