Class FLACOutputBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sinks
- Assembly
- VisioForge.Core.dll
FLAC (Free Lossless Audio Codec) output block for creating high-quality lossless audio files with professional audio encoding. Provides uncompressed audio archival and professional audio production with configurable FLAC encoding for music production, audio mastering, and high-fidelity audio content creation with industry-standard lossless compression for audiophile-quality audio preservation. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class FLACOutputBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
FLACOutputBlock(string, FLACEncoderSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.FLACOutputBlock class with custom FLAC encoder settings. Provides full control over lossless audio compression parameters for professional FLAC file creation.
public FLACOutputBlock(string filename, FLACEncoderSettings settings)Parameters
filenamestring-
The output FLAC file path where the lossless audio content will be written.
settingsFLACEncoderSettings-
The FLAC encoder settings controlling lossless compression quality and parameters.
Properties
Input
Gets the audio input pad for receiving audio streams.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads available on this block (single audio input for FLAC encoding).
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad (none for output blocks that write to files).
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (none for output blocks).
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the media block type identifier for FLAC output operations.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the FLAC output block within the pipeline context. Creates the file sink, FLAC encoder, and establishes all necessary connections for lossless encoding and writing audio content to the FLAC file.
public override bool Build()Returns
- bool
-
trueif the FLAC output block was successfully built and configured; otherwise,false.
CleanUp()
Cleans up all resources associated with the FLAC output operations, including encoder, sink, and file handles.
public void CleanUp()Dispose(bool)
Releases unmanaged and managed resources used by the FLAC output block. Properly disposes of GStreamer elements, encoder, and file writing 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 wrapper for advanced configuration and monitoring.
public BaseElement GetCore()Returns
- BaseElement
-
Always null for composite output blocks with multiple internal elements.
GetElement()
Gets the native GStreamer element for direct GStreamer pipeline integration.
public Element GetElement()Returns
- Element
-
Always null for composite output blocks with multiple internal elements.
GetFilenameOrURL()
Gets the current output filename or URL where the FLAC content is being written.
public string GetFilenameOrURL()Returns
- string
-
The file path or URL string for the FLAC output destination.
IsAvailable()
Determines whether FLAC output functionality is available on the current system. Requires GStreamer FLAC encoder and file sink plugins to be installed and functional.
public static bool IsAvailable()Returns
- bool
-
trueif FLAC output is supported; otherwise,false.
SetFilenameOrURL(string)
Updates the output filename or URL for the FLAC file destination, allowing dynamic output redirection.
public void SetFilenameOrURL(string value)Parameters
valuestring-
The new file path or URL where FLAC content should be written.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this FLAC output block, providing access to the parent pipeline and logging context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this FLAC output block.