Moon
Moon

Reputation: 20032

How can I play a sound in WinForms?

How can I play a sound in WinForms with C#?

Upvotes: 16

Views: 19523

Answers (2)

Sebastian Gray
Sebastian Gray

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

Karl Johan
Karl Johan

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

Related Questions