# Scale/Tempo

Media Blocks SDK .Net

The block scales tempo while maintaining pitch.

# Block info

Name: ScaleTempoBlock.

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

# The sample pipeline

graph LR;
    UniversalSourceBlock-->ScaleTempoBlock;
    ScaleTempoBlock-->AudioRendererBlock;

# Sample code

var pipeline = new MediaBlocksPipeline();

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

var tempo = new ScaleTempoBlock();
tempo.Overlap = 0.2;
tempo.Rate = 0.1;
tempo.Search = TimeSpan.FromMilliseconds(14);
tempo.Stride = TimeSpan.FromMilliseconds(30); 
pipeline.Connect(fileSource.AudioOutput, tempo.Input);

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

await pipeline.StartAsync();

# Platforms

Windows, macOS, Linux, iOS, Android.