Class OGGSpeexOutputBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sinks
- Assembly
- VisioForge.Core.dll
OGG Speex output block for creating compressed voice audio files optimized for speech content. This block combines Speex audio encoding with OGG container packaging, providing an efficient solution for voice recording, VoIP applications, and speech archival. Speex is specifically designed for speech compression, offering superior quality at low bitrates compared to general-purpose audio codecs. The OGG container provides an open, patent-free format with excellent streaming capabilities and metadata support.
Key features:
- Ultra-efficient speech compression (2-44 kbps)
- Voice Activity Detection (VAD) for silence suppression
- Variable bitrate (VBR) encoding for optimal quality/size ratio
- Wideband (16 kHz) and ultra-wideband (32 kHz) support
- Acoustic echo cancellation compatibility
- Packet loss concealment for streaming applications
Common use cases:
- Voice recording and dictation systems
- Podcast production with speech-only content
- VoIP and telecommunication applications
- Audio books and spoken word archives
- Voice memo and note-taking applications
- Language learning materials
While Speex has been largely superseded by Opus for new applications, it remains valuable for legacy system compatibility and specific speech-only scenarios where its optimizations provide benefits. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class OGGSpeexOutputBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
OGGSpeexOutputBlock(string, SpeexEncoderSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.OGGSpeexOutputBlock class. Creates an output block configured for speech compression using Speex codec in an OGG container, ideal for voice recording and telecommunication applications.
public OGGSpeexOutputBlock(string filename, SpeexEncoderSettings settings)Parameters
filenamestring-
The output file path for the OGG Speex audio file.
settingsSpeexEncoderSettings-
The Speex encoder settings defining quality, bitrate, and speech optimization parameters.
Properties
Input
Gets the primary input pad for audio data.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads available on this block.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad. Always null for file output blocks.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads. Empty for file output blocks.
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the block type identifier for the OGG Speex output.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the OGG Speex output pipeline. Creates the Speex encoder, OGG muxer, and file sink, then connects them to form a complete speech encoding and packaging pipeline.
public override bool Build()Returns
- bool
-
trueif the output pipeline was successfully built;falseif initialization failed.
CleanUp()
Performs cleanup of all resources associated with the OGG Speex output. Disposes the encoder, sink, and releases file handles.
public void CleanUp()Dispose(bool)
Releases unmanaged and - optionally - managed resources. Ensures proper cleanup of encoder, muxer, and file resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
GetCore()
Gets the core GStreamer element. Not applicable for composite blocks.
public BaseElement GetCore()Returns
- BaseElement
-
Always null for composite output blocks with multiple elements.
GetElement()
Gets the underlying GStreamer element. Not applicable for composite blocks.
public Element GetElement()Returns
- Element
-
Always null for composite output blocks with multiple elements.
GetFilenameOrURL()
Gets the current output filename where the OGG Speex audio is being written.
public string GetFilenameOrURL()Returns
- string
-
The file path for the OGG Speex output.
IsAvailable()
Determines whether OGG Speex output functionality is available on the current system. Requires the GStreamer Speex plugin and OGG muxer to be installed.
public static bool IsAvailable()Returns
- bool
-
trueif OGG Speex encoding is supported; otherwise,false.
SetFilenameOrURL(string)
Sets a new output filename for the OGG Speex file. Allows changing the output destination during pipeline operation.
public void SetFilenameOrURL(string value)Parameters
valuestring-
The new file path for OGG Speex output.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the media pipeline context for this output block.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent media pipeline containing this block.