Reputation: 20032
How can I play a sound in WinForms with C#?
Upvotes: 16
Views: 19523
Reputation: 2704
NAudio is a great library to reproduce sound, you can find it here: http://naudio.codeplex.com/
And the tutorial is here: http://opensebj.blogspot.com/2009/02/introduction-to-using-naudio.html
Upvotes: 9
Reputation: 4042
For playing sound simply, with no interaction you can use System.Media.SoundPlayer:
System.Media.SoundPlayer player = new System.Media.SoundPlayer();
player.SoundLocation = "soundFile.wav";
player.Play();
Upvotes: 26