title: C# - How to make the BiQuadFilter Code work
body: <p>I have to following C# code which passes my WAV file through a low pass filter. I am using NAudio's <code>BiQuadFilter</code> for this. However there is no changes in the sound and it is still the same. </p>
  
  <p>My code:</p>
  
  <pre><code>    public void setValues(ISampleProvider sourceProvider,int cutOffFreq)
      {
          this.sourceProvider = sourceProvider;
          this.cutOffFreq = cutOffFreq;
  
          filter_LowPass();
      }
  
      private void filter_LowPass()
      {
          channels = sourceProvider.WaveFormat.Channels;
          filters = new BiQuadFilter[channels];
  
          for (int n = 0; n &lt; channels; n++)
              if (filters[n] == null)
                  filters[n] = BiQuadFilter.LowPassFilter(44100, cutOffFreq, 1);
              else
                  filters[n].SetLowPassFilter(44100, cutOffFreq, 1);
      }
  
      public WaveFormat WaveFormat { get { return sourceProvider.WaveFormat; } }
  
      public int Read(float[] buffer, int offset, int count)
      {
          int samplesRead = sourceProvider.Read(buffer, offset, count);
  
          for (int i = 0; i &lt; samplesRead; i++)
              buffer[offset + i] = filters[(i % channels)].Transform(buffer[offset + i]);
  
          return samplesRead;
      }
  </code></pre>
  
  <p>This is in a class called <code>MyFilter</code> and I am calling it this way:</p>
  
  <pre><code>        audioFileReader = new AudioFileReader("a.wav");
  
          myFilter.setValues(audioFileReader, currentCutOff);
  
          waveOut.Init(audioFileReader);
  
          waveOut.Play();
  </code></pre>
  
  <p>The cut off values being passed (in this order only) are: 3000,2500,2000,1500 and 1000, however, there is no change being felt when cut off changes.</p>