When I try to play the sound file "Windows Critical Stop.wav" I get the following exception: exec {"Sound API only supports playing PCM wave files."} System.Exception {System.InvalidOperationException}
I understand what PCM is, I just do not know how to either: 1) play the sound file, 2) determine apiori that it is not PCM and will not play, and block the file from being choosen.
Here is the code I am using:
SoundPlayer player = new SoundPlayer();
player.SoundLocation = FileNameTextBox.Text;
try
{
player.Play();
}
catch (Exception exec)
{
MessageBox.Show("Sound could not be played: " + exec.ToString());
}