Skip to main content

WMA v2 encoder

WMA (Windows Media Audio): Developed by Microsoft, this series of audio codecs and formats is known for efficient compression and high sound quality and is suitable for various audio streaming applications.

The WMA encoder is used to encode files in WMA and WMV formats.

Use the WMA2EncoderSettings class to set the parameters.

Block info

Name: WMA2EncoderBlock.

Pin directionMedia typePins count
InputF32LE1
OutputWMA (v2)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 audioEncoderBlock = new WMA2EncoderBlock(new WMA2EncoderSettings());
pipeline.Connect(fileSource.AudioOutput, audioEncoderBlock.Input);

var sinkBlock = new ASFSinkBlock(new ASFSinkSettings(@"output.wma"));
pipeline.Connect(audioEncoderBlock.Output, sinkBlock.CreateNewInput(MediaBlockPadMediaType.Audio));

await pipeline.StartAsync();

Platforms

Windows, macOS, Linux, Android.