# ADPCM encoder

Media Blocks SDK .Net

ADPCM (Adaptive Differential Pulse Code Modulation): A method of encoding audio that reduces data size by predicting subsequent samples, widely used in video game audio and telephony.

ADPCM encoder is used to encode an audio stream in ADPCM format.

# Block info

Name: ADPCMEncoderBlock.

Pin direction Media type Pins count
Input PCM 1
Output audio/x-adpcm 1

# The sample pipeline

graph LR;
    UniversalSourceBlock-->ADPCMEncoderBlock;
    ADPCMEncoderBlock-->WAVSinkBlock;

# Sample code

var pipeline = new MediaBlocksPipeline();

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

var adpcmEncoderBlock = new ADPCMEncoderBlock();

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

var wavSinkBlock = new WAVSinkBlock(@"output.wav");
pipeline.Connect(adpcmEncoderBlock.Output, wavSinkBlock.Input);

await pipeline.StartAsync();

# Platforms

Windows, macOS, Linux, iOS, Android.