ALAW/G.711 encoder
ALAW
: A companding algorithm used primarily in voice communications, notably in telephone systems, that compresses audio data to reduce bandwidth usage while maintaining sound integrity.
ALAW/G.711 encoder is used to encode audio streams in ALAW format.
Block info
Name: ALAWEncoderBlock.
Pin direction | Media type | Pins count |
---|---|---|
Input | PCM | 1 |
Output | audio/x-alaw | 1 |
The sample pipeline
Sample code
var pipeline = new MediaBlocksPipeline();
var filename = "test.mp3";
var fileSource = new UniversalSourceBlock(await UniversalSourceSettings.CreateAsync(new Uri(filename)));
var alawEncoderBlock = new ALAWEncoderBlock();
pipeline.Connect(fileSource.AudioOutput, alawEncoderBlock.Input);
var wavSinkBlock = new WAVSinkBlock(@"output.wav");
pipeline.Connect(alawEncoderBlock.Output, wavSinkBlock.Input);
await pipeline.StartAsync();
Platforms
Windows, macOS, Linux, iOS, Android.