Skip to main content

Speex encoder

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

Use SpeexEncoderSettings class to set the parameters.

Block info

Name: SpeexEncoderBlock.

Pin directionMedia typePins count
InputPCM/IEEE1
Outputaudio/x-speex1

The sample pipeline

FileSourceBlock SpeexEncoderBlock OGGSinkBlock

Sample code

var pipeline = new MediaBlocksPipeline(false);

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

var speexEncoderBlock = new SpeexEncoderBlock(new SpeexEncoderSettings());
pipeline.Connect(fileSource.Output, speexEncoderBlock.Input);

var oggSinkBlock = new OGGSinkBlock(new OGGSinkSettings(@"output.ogg"));
pipeline.Connect(speexEncoderBlock.Output, oggSinkBlock.CreateNewInput(MediaBlockPadMediaType.Audio));

await pipeline.StartAsync();

Platforms

Windows, macOS, Linux, iOS, Android.