Saturday, February 14, 2009

Play sound from Window Form in C#

Playing a sound from window forms in C# is simple because of SoundPlayer class from System.Media namespace.

SoundPlayer objSoundPlayer = new SoundPlayer("sound1.wav");
objSoundPlayer .Play();

No comments: