C#.NET app needs to trigger sound wave files

Posted on 2007-10-08
Last Modified: 2013-12-17
How do I trigger a sound wave file (.wav) from a C#.NET application using VS 2005?
Question by:alexmcferron
    LVL 11

    Accepted Solution

    Try this:

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

    Assisted Solution

    .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]

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now