Search code examples
c#equalizercscore

why CSCore equalizer SampleFilters[9] (16Khz) does not affect at all in C#


I recently found that if I want to add equalizer to my application I can use CSCore library! I tested it and it's good! but the problem is that 16Khz equalizer Band (Treble) does not have any effect at all!! What's wrong what should I do? I even tried real high numbers! but no effects. :(

_equalizer.SampleFilters[9].AverageGainDB = 35.5;

Other channels works well (0-8).


Solution

  • I found what's wrong! I've got the solution :) the problem was from the Equalizer Sample Source Code I've downloaded from CScore Codeplex Page

    var source = CodecFactory.Instance.GetCodec(ofn.FileName)
                    .Loop()
                    .ChangeSampleRate(32000)
                    .AppendSource(Equalizer.Create10BandEqualizer, out _equalizer)
                    .ToWaveSource();
    

    I commented the ".ChangeSampleRate" Part and it has been solved!

    I changed it to:

    source = CodecFactory.Instance.GetCodec(ofn.FileName)
                    .Loop()
                    .ChangeSampleRate(44100)
                    .AppendSource(Equalizer.Create10BandEqualizer, out _equalizer)
                    .ToWaveSource();