title: playing .wav file with C#
body: <p>I'm trying to play a .Wav file thats located in a folder inside my project.</p>
  
  <p>The sound file is located on "Resource/Sounds/slot_roll_on.Wav"</p>
  
  <p>The resource folder is a folder I created myself, in the root of the project.</p>
  
  <p>This is the code I'm using to run the .wav file</p>
  
  <pre><code>        Assembly a = Assembly.GetExecutingAssembly();
          Stream s = a.GetManifestResourceStream("kisscam.g.resources.Resources.Sounds.slot_roll_on.wav");
          SoundPlayer snd = new SoundPlayer(s);
          snd.Play();
  </code></pre>
  
  <p>I couldn't get the sound to play, I keep getting the windows sound for sound not found.</p>
  
  <p>Somewhere on stack overflow I found this code to find what the right assembly path should be.</p>
  
  <pre><code>            Assembly a = Assembly.GetExecutingAssembly();
              string[] resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
              int i;
              for (i = 0; i &lt; resourceNames.Length; i++)
              {
  
                  MessageBox.Show(resourceNames[i]);
  
  
              }
  </code></pre>
  
  <p>It output these 2 paths</p>
  
  <pre><code>kisscam.Properties.Resources.resources
  </code></pre>
  
  <p>and</p>
  
  <pre><code>kissscam.g.resources
  </code></pre>
  
  <p>I tried using them both, but none of them works.</p>
  
  <p>Anyone know what I'm doing wrong ?</p>