?
Solved

C#.NET app needs to trigger sound wave files

Posted on 2007-10-08
2
Medium Priority
?
637 Views
Last Modified: 2013-12-17
How do I trigger a sound wave file (.wav) from a C#.NET application using VS 2005?
0
Comment
Question by:alexmac05
2 Comments
 
LVL 11

Accepted Solution

by:
udhayakumard earned 1000 total points
ID: 20034821
Try this:

System.Media.SoundPlayer myPlayer = new System.Media.SoundPlayer();
myPlayer.SoundLocation = @"c:\click.wav";
myPlayer.Play();
0
 
LVL 7

Assisted Solution

by:joesthebighmoe
joesthebighmoe earned 1000 total points
ID: 20034849
.Net 2.0 has a new namespace called System.Media
So playing a sound is as easy as creating a Player object
System.Media.Player myPlayer = new System.Media.Player();
myPlayer.SoundLocation = [path to wav file]
myPlayer.Play();
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question