title: How to convert a 16 bit PCM: 44kHz 2 channels with a sample rate of 44100 to a mp3 file
body: <p>I need to convert a 16 bit PCM: 44kHz 2 channels wave file to mp3 format.</p>
  
  <p>I'm converting this to compress the size of the wave file.</p>
  
  <p>I tried using NAudio.Lame</p>
  
  <pre><code>public static byte[] ConvertWavToMp3(byte[] wavFile)
      {
  
         using (var retMs = new MemoryStream())
         using (var ms = new MemoryStream(wavFile))
         using (var rdr = new WaveFileReader(ms))
         using (var wtr = new LameMP3FileWriter(retMs, rdr.WaveFormat, 128))
         {
             rdr.CopyTo(wtr);
             return retMs.ToArray();
         }
  </code></pre>
  
  <p>But this throws an error:</p>
  
  <p>NAudio.Wave.WaveFileReader' does not contain a definition for 'CopyTo' and no extension method 'CopyTo' accepting a first argument of type 'NAudio.Wave.WaveFileReader' could be found </p>
  
  <p>I throws another error:</p>
  
  <p>Error   3   The type or namespace name 'Lame' does not exist in the namespace 'NAudio' (are you missing an assembly reference?) </p>
  
  <p>Please help me out.</p>