title: C# Play MP3 file using NAudio from Resource
body: <p>I have a Windows Forms Application where I'm trying to simply play an MP3 file from the Resource using the NAudio library.</p>
  
  <p>I believe what needs to be done is to stream the file somehow, here is an example of NAudio, unfortunately it accepts File path string as an argument.</p>
  
  <pre><code>private WaveStream CreateInputStream(string fileName)
  {
      WaveChannel32 inputStream;
      if (fileName.EndsWith(".mp3"))
      {
          WaveStream mp3Reader = new Mp3FileReader(fileName);
          inputStream = new WaveChannel32(mp3Reader);
      }
      else
      {
          throw new InvalidOperationException("Unsupported extension");
      }
      volumeStream = inputStream;
      return volumeStream;
  }
  </code></pre>
  
  <p>To play the file:</p>
  
  <pre><code>waveOutDevice = new WaveOut();
  mainOutputStream = CreateInputStream("C:\\song.mp3");
  </code></pre>
  
  <p>Works fine with normal files, how would I go about files that are located in the Resources?
  Thank you.</p>