title: How to convert any audio format to mp3 using NAudio
body: <pre><code>public void AudioConvert()
  {    
      FileStream fs = new FileStream(InputFileName, FileMode.Open, FileAccess.Read);            
      NAudio.Wave.WaveFormat format = new NAudio.Wave.WaveFormat();
      NAudio.Wave.WaveStream rawStream = new RawSourceWaveStream(fs, format);
      NAudio.Wave.WaveStream wsDATA = WaveFormatConversionStream.CreatePcmStream(rawStream);
      WaveStream wsstream = wst.CanConvertPcmToMp3(2, 44100);
      .....
  }
  
  // Here is the class 
  public class WaveFormatConversionStreamTests
  {
      public WaveStream CanConvertPcmToMp3(int channels,int sampleRate)
      {           
          WaveStream ws = CanCreateConversionStream(
              new WaveFormat(sampleRate, 16, channels),
              new Mp3WaveFormat(sampleRate, channels, 0, 128000/8));
          return ws;
      }
  }
  </code></pre>
  
  <p>Here, i am trying to convert any audio format to mp3 but my code is throwing exception like "ACMNotPossible" at ConvertPCMToMp3 function call. I am using NAudio 1.6 version dll. Right now i am working on windows 7. Please tell me where i went wrong in this code.</p>