Skip to main content

Compressor/Expander

This block can work as a compressor or expander.

Block info

Name: CompressorExpanderBlock.

Pin directionMedia typePins count
InputUncompressed audio1
OutputUncompressed audio1

The sample pipeline

UniversalSourceBlockCompressorExpanderBlockAudioRendererBlock

Sample code

var pipeline = new MediaBlocksPipeline(false);

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

var compressor = new CompressorExpanderBlock();
pipeline.Connect(fileSource.AudioOutput, compressor.Input);

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

await pipeline.StartAsync();

Platforms

Windows, macOS, Linux, iOS, Android.