Skip to main content

Scale/Tempo

The block scales tempo while maintaining pitch.

Block info

Name: ScaleTempoBlock.

Pin directionMedia typePins count
InputUncompressed audio1
OutputUncompressed audio1

The sample pipeline

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.