# Volume

Media Blocks SDK .Net

The volume block changes the volume of the audio data.

Use the Level property to set the parameters.

# Block info

Name: VolumeBlock.

Pin direction Media type Pins count
Input Uncompressed audio 1
Output Uncompressed audio 1

# The sample pipeline

graph LR;
    UniversalSourceBlock-->VolumeBlock;
    VolumeBlock-->AudioRendererBlock;

# Sample code

var pipeline = new MediaBlocksPipeline();

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

var volume = new VolumeBlock();
volume.Level = 2.0;
pipeline.Connect(fileSource.AudioOutput, volume.Input);

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

await pipeline.StartAsync();

# Platforms

Windows, macOS, Linux, iOS, Android.