title: How to play a sound file?
body: <p>I have found a solution on here to play a sound file in WPF which I extracted into a method and call this method in another method. But the when the <code>PlaySound()</code> is called the sound doesn't play. Does anyone have any insight as to why this is happening? Also the sound files are marked as content, but changing to type resource didn't remedy the problem either?</p>
  
  <p>My method to play a sound:</p>
  
  <pre><code>private void PlaySound()
  {
       Uri uri = new Uri(@"pack://application:,,,/Sounds/jabSound.wav");
       var player = new MediaPlayer();
       player.Open(uri);
       player.Play();
  }
  </code></pre>
  
  <p>Then I call the method like this but its doesn't play the sound file, <code>PlaySound();</code></p>