title: C# play embedded mp3 file
body: <p>I know there are a dozen questions like this and I looked at the more popular ones, but I have had no luck in figuring out anything.</p>
  
  <p>I want to make a C# *.exe that would play a sound when opened, I decided it would be OK to start with a Console Application project, but I have no idea if that is the best choice.</p>
  
  <p>I have added the "file.mp3" file to the resource designer under "Other" files and set its build action to "Embedded Resource".</p>
  
  <p>From there I saw the suggestion about WMPLib, which I cannot access in my project - it is not present neither in my Reference Manager, neither does "using WMPLib;" work (it raises a "could not be found" error) or the one about the "System.Media.SoundPlayer.Play();" method but I am having trouble implementing it, because my complier either says an object reference is required for it or it has no overload, because it only takes 1 arguments if I make it like "System.Media.SoundPlayer.Play("file.mp3");"</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace ConsoleApplication1
  {
      class Program
      {
          static void Main(string[] args)
          {
              Program p = new Program();
              p.Mum();
          }
          void Mum()
          {
              System.Media.SoundPlayer.Play();
          }
      }
  }
  </code></pre>