Skip to main content

FLAC encoder

FLAC encoder is used when encoding files in FLAC, WebM, MKV, and some other formats.

Use FLACEncoderSettings class to set the parameters.

Block info

Name: FLACEncoderBlock.

Pin directionMedia typePins count
InputPCM/IEEE1
OutputFLAC1

The sample pipeline

FileSourceBlock FLACEncoderBlock FileSinkBlock

Sample code

var pipeline = new MediaBlocksPipeline(false);

var fileSource = new FileSourceBlock();
fileSource.Filename = "test.mp3";

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.