Skip to main content

ADPCM encoder

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 directionMedia typePins count
InputPCM1
Outputaudio/x-adpcm1

The sample pipeline

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.