Skip to main content

Equalizer (Parametric)

The parametric equalizer block allows selection between 1 and 64 bands. You can change the center frequency, bandwidth and gain for each band.

Use the SetNumBands method to set the number of bands. Use the SetState method to set each band state.

Block info

Name: EqualizerParametricBlock.

Pin directionMedia typePins count
InputUncompressed audio1
OutputUncompressed audio1

The sample pipeline

Sample code

var pipeline = new MediaBlocksPipeline(false);

var filename = "test.mp3";
var fileSource = new UniversalSourceBlock(await UniversalSourceSettings.CreateAsync(new Uri(filename)));

var eq = new EqualizerParametricBlock();
eq.SetNumBands(5);
eq.SetState(0, new ParametricEqualizerBand(120.0f, 50.0f, -3.0f));
eq.SetState(1, new ParametricEqualizerBand(500.0f, 20.0f, 12.0f));
eq.SetState(2, new ParametricEqualizerBand(1503.0f, 2.0f, -20.0f));
eq.SetState(3, new ParametricEqualizerBand(6000.0f, 1000.0f, 6.0f));
eq.SetState(4, new ParametricEqualizerBand(3000.0f, 120.0f, 2.0f));

pipeline.Connect(fileSource.AudioOutput, eq.Input);

var audioRenderer = new AudioRendererBlock();
pipeline.Connect(eq.Output, audioRenderer.Input);

await pipeline.StartAsync();

Platforms

Windows, macOS, Linux, iOS, Android.