Example #1
0
        public static EqFilterCollection Create10BandEqFilter(int sampleRate, int channelCount, float bandWidth = 18, float defaultGain = 0)
        {
            var sampleFilters = new EqFilter[]
            {
                new EqFilter(sampleRate, 31, bandWidth, defaultGain),
                new EqFilter(sampleRate, 62, bandWidth, defaultGain),
                new EqFilter(sampleRate, 125, bandWidth, defaultGain),
                new EqFilter(sampleRate, 250, bandWidth, defaultGain),
                new EqFilter(sampleRate, 500, bandWidth, defaultGain),
                new EqFilter(sampleRate, 1000, bandWidth, defaultGain),
                new EqFilter(sampleRate, 2000, bandWidth, defaultGain),
                new EqFilter(sampleRate, 4000, bandWidth, defaultGain),
                new EqFilter(sampleRate, 8000, bandWidth, defaultGain),
                new EqFilter(sampleRate, 16000, bandWidth, defaultGain)
            };

            EqFilterCollection filterCollection = new EqFilterCollection(channelCount);

            foreach (var filter in sampleFilters)
            {
                filterCollection.Add(filter);
            }

            return(filterCollection);
        }
Example #2
0
 public void Add(EqFilter filter)
 {
     if (filter == null)
     {
         throw new ArgumentNullException("filter");
     }
     _filters.Add(new EqFilterEntry(_channelCount, filter));
 }
Example #3
0
        public static EqFilterCollection Create10BandEqFilter(int sampleRate, int channelCount, float bandWidth = 18, float defaultGain = 0)
        {
            var sampleFilters = new EqFilter[]
            {
                new EqFilter(sampleRate, 31, bandWidth, defaultGain),
                new EqFilter(sampleRate, 62, bandWidth, defaultGain),
                new EqFilter(sampleRate, 125, bandWidth, defaultGain),
                new EqFilter(sampleRate, 250, bandWidth, defaultGain),
                new EqFilter(sampleRate, 500, bandWidth, defaultGain),
                new EqFilter(sampleRate, 1000, bandWidth, defaultGain),
                new EqFilter(sampleRate, 2000, bandWidth, defaultGain),
                new EqFilter(sampleRate, 4000, bandWidth, defaultGain),
                new EqFilter(sampleRate, 8000, bandWidth, defaultGain),
                new EqFilter(sampleRate, 16000, bandWidth, defaultGain)
            };

            EqFilterCollection filterCollection = new EqFilterCollection(channelCount);
            foreach (var filter in sampleFilters)
            {
                filterCollection.Add(filter);
            }

            return filterCollection;
        }