Skip to main content

FLAC encoder

FLAC (Free Lossless Audio Codec): An audio format that compresses without any loss of quality, ensuring perfect sound reproduction, commonly used by audiophiles.

FLAC Encoder is used to encode files into FLAC, WebM, MKV, and other formats.

Use the FLACEncoderSettings class to set the parameters.

Block info

Name: FLACEncoderBlock.

Pin directionMedia typePins count
InputPCM/IEEE1
OutputFLAC1

The sample pipeline

Sample code

var pipeline = new MediaBlocksPipeline();

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

var flacEncoderBlock = new FLACEncoderBlock(new FLACEncoderSettings());
pipeline.Connect(fileSource.AudioOutput, flacEncoderBlock.Input);

var fileSinkBlock = new FileSinkBlock(@"output.flac");
pipeline.Connect(flacEncoderBlock.Output, fileSinkBlock.Input);

await pipeline.StartAsync();

Platforms

Windows, macOS, Linux, iOS, Android.