title: NAudio Resampling in 2016?
body: <p><a href="http://mark-dot-net.blogspot.com/2014/05/how-to-resample-audio-with-naudio.html?m=1" rel="nofollow">http://mark-dot-net.blogspot.com/2014/05/how-to-resample-audio-with-naudio.html?m=1</a></p>
  
  <p>I followed that link to make some simple code for downmixing an 8KHz WAV audio to 4100KHz.
  Some of those samples work and make recognizable output, others make only noise/groaning.
  I do not think it is the NAudio code itself, but how the codecs work.
  Can someone point me to sample code that shows how to enumerate codecs installed in Windows 10,
  or enumerate what comes with NAudio, so the various output types can be compared?
  I looked at IResampler but am missing something...</p>
  
  <p>This does not make recognizable sound:</p>
  
  <pre><code>using ( var waveFileReader = new AudioFileReader( FileNameIn ) )
  {
      var outFormat = WaveFormat.CreateIeeeFloatWaveFormat( 4100 , waveFileReader.WaveFormat.Channels );
      using ( var resamplerCurrent = new MediaFoundationResampler( waveFileReader , outFormat ) )
      {
          resamplerCurrent.ResamplerQuality = 60;
          WaveFileWriter.CreateWaveFile( tmpFile , resamplerCurrent );
      }
  }
  </code></pre>
  
  <p>These examples both make recognizable sound:</p>
  
  <pre><code>using ( var waveFileReader = new AudioFileReader( FileNameIn ) )
  {
      var outFormat = new WaveFormat( 4100 , waveFileReader.WaveFormat.Channels );
      using ( var resamplerCurrent = new MediaFoundationResampler( waveFileReader , outFormat ) )
      {
          resamplerCurrent.ResamplerQuality = 60;
          WaveFileWriter.CreateWaveFile( tmpFile , resamplerCurrent );
      }
  }
  using ( var waveFileReader = new AudioFileReader( FileNameIn ) )
  {
      var resamplerCurrent = new WdlResamplingSampleProvider( waveFileReader , 4100 );
      WaveFileWriter.CreateWaveFile16( tmpFile , resamplerCurrent );
  }
  </code></pre>
  
  <p>Thanks.</p>