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 direction | Media type | Pins count |
---|---|---|
Input | PCM/IEEE | 1 |
Output | audio/x-speex | 1 |
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.