I know this has been asked before but am still not able to play a wav file in wpf.
This is the code I am using.
<MediaElement Name="mediaSound" LoadedBehavior="Manual" Source="Alarm10.wav"/>
and
try
{
mediaSound.Play();
}
catch (Exception a)
{
MessageBox.Show(a.Message);
}
No exception is thrown and the sound is not played.