C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Play Audio Files (Wav) With C#


Posted Date: 02 Jul 2008    Resource Type: Code Snippets    Category: Sounds
Author: sivaMember Level: Silver    
Rating: Points: 10



The sample below is a snippet that shows how to play audio files with C#.



using System.Media;
// the following function can be appropriately inserted in a class
void PlayAudio (string path)
{
SoundPlayer Mplayer=new SoundPlayer ();
Mplayer.SoundLocation=path;
Mplayer.Play();
}



The example further extends by having an event handler for a Form's Load event. So, the audio file is played when the form is loaded.



//play Audio file(Wav)on form load

Private Void Form_Load(object sender,EventArgs e)
{
PlayAudio("c:\\sample.wav");
}





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Wav files  .  Audio files  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to create C# talking applications using MS speech library
Return to Discussion Resource Index
Post New Resource
Category: Sounds


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use