How To Play AWAV File

The Simple-ish Way

Download: PlayWav.zip
Unzip all files (executables plus dependencies) into a single folder.

Windows has code that you can call to play a WAV file given the filename. The disadvantage is that it requires some set-up that most C# beginners will struggle with.

The sample program below contains a class called PlayWav which encapsulates this lower-level code. Simply use it as follows:

PlayWav.Play("filename.wav");

This class will complain if the file doesn't exist or if the file extension is something other than a .WAV.