Class OGGVorbisOutputBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sinks
- Assembly
- VisioForge.Core.dll
OGG Vorbis output block for creating high-quality compressed audio files using the open-source Vorbis codec. This block combines Vorbis audio encoding with OGG container packaging, providing an excellent solution for music distribution, streaming audio, and multimedia content creation. Vorbis offers superior audio quality compared to MP3 at similar bitrates, making it ideal for applications where audio fidelity is paramount. The OGG container provides a patent-free, open standard format with robust streaming capabilities and comprehensive metadata support.
Key features:
- High-quality lossy audio compression (45-500 kbps)
- Superior sound quality at low to medium bitrates
- Variable bitrate (VBR) encoding for optimal quality/size ratio
- Support for sample rates up to 192 kHz
- Multi-channel audio support (mono to 7.1 surround)
- Comprehensive metadata tagging (Vorbis comments)
- Streaming-optimized container format
Common use cases:
- Music distribution and archival
- Game audio assets and soundtracks
- Podcast and audiobook production
- Web audio streaming applications
- Open-source multimedia projects
- Cross-platform audio solutions
Vorbis remains an excellent choice for applications requiring patent-free, high-quality audio compression with broad platform support and superior performance at medium bitrates. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class OGGVorbisOutputBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
OGGVorbisOutputBlock(string, VorbisEncoderSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.OGGVorbisOutputBlock class. Creates an output block configured for high-quality audio compression using the Vorbis codec in an OGG container, ideal for music and multimedia applications.
public OGGVorbisOutputBlock(string filename, VorbisEncoderSettings settings)Parameters
filenamestring-
The output file path for the OGG Vorbis audio file.
settingsVorbisEncoderSettings-
The Vorbis encoder settings defining quality, bitrate, and compression parameters.
OGGVorbisOutputBlock(string, VorbisEncoderSettings, MediaFileTags)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.OGGVorbisOutputBlock class. Creates an output block configured for high-quality audio compression using the Vorbis codec in an OGG container, ideal for music and multimedia applications.
public OGGVorbisOutputBlock(string filename, VorbisEncoderSettings settings, MediaFileTags tags)Parameters
filenamestring-
The output file path for the OGG Vorbis audio file.
settingsVorbisEncoderSettings-
The Vorbis encoder settings defining quality, bitrate, and compression parameters.
tagsMediaFileTags-
The metadata tags to be written to the OGG Vorbis file, including title, artist, album, and other information.
OGGVorbisOutputBlock(string)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.OGGVorbisOutputBlock class. Creates an output block configured for high-quality audio compression using the Vorbis codec in an OGG container, ideal for music and multimedia applications.
public OGGVorbisOutputBlock(string filename)Parameters
filenamestring-
The output file path for the OGG Vorbis audio file.
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
Tags
Gets or sets the metadata tags to be written to the OGG Vorbis file. These tags include information such as title, artist, album, year, and other audio metadata. Tags can be set before building the pipeline and will be applied during the encoding process.
public MediaFileTags Tags { get; set; }Property Value
Type
Gets the block type identifier for the OGG Vorbis output.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the OGG Vorbis output pipeline. Creates the Vorbis encoder, OGG muxer, and file sink, then connects them to form a complete audio encoding and packaging pipeline with metadata tags.
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 Vorbis 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 Vorbis audio is being written.
public string GetFilenameOrURL()Returns
- string
-
The file path for the OGG Vorbis output.
IsAvailable()
Determines whether OGG Vorbis output functionality is available on the current system. Requires the GStreamer Vorbis plugin and OGG muxer to be installed.
public static bool IsAvailable()Returns
- bool
-
trueif OGG Vorbis encoding is supported; otherwise,false.
SetFilenameOrURL(string)
Sets a new output filename for the OGG Vorbis file. Allows changing the output destination during pipeline operation.
public void SetFilenameOrURL(string value)Parameters
valuestring-
The new file path for OGG Vorbis 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.