Playing a .WAV file in .NET

Mori picture Mori · Aug 16, 2009 · Viewed 21k times · Source

I'm trying to write a SAMPLER program, where each key has a different sound (a WAV file).

Can someone explain to me or give me a link to an explanation where i can learn how to play the WAV files?

If it matters, I'm working with Microsoft Visual C# and using WinForms.

Answer

Arsen Mkrtchyan picture Arsen Mkrtchyan · Aug 16, 2009
SoundPlayer simpleSound = new SoundPlayer(strAudioFilePath);
simpleSound.Play();