Table of Contents

Class AACEncoderBlock

Namespace
VisioForge.Core.MediaBlocks.AudioEncoders
Assembly
VisioForge.Core.dll

MediaBlock that encodes raw audio into AAC (Advanced Audio Coding) format. AAC is a widely supported audio format offering better quality than MP3 at similar bitrates, commonly used in streaming, broadcasting, and mobile applications. This block supports platform-specific encoders for optimal performance. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class AACEncoderBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

AACEncoderBlock(IAACEncoderSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.AudioEncoders.AACEncoderBlock class.

public AACEncoderBlock(IAACEncoderSettings settings = null)

Parameters

settings IAACEncoderSettings

The settings.

Properties

Input

Gets the single audio input pad for this encoder block.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads for this encoder block.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the single audio output pad for this encoder block.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads for this encoder block.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the AAC encoder settings that control compression quality and encoding parameters. These settings determine bitrate (typically 64-320 kbps), profile (AAC-LC, HE-AAC, HE-AACv2), and platform-specific optimizations for the encoded output.

public IAACEncoderSettings Settings { get; set; }

Property Value

IAACEncoderSettings

Type

Gets the MediaBlock type identifier for this encoder.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds this instance.

public override bool Build()

Returns

bool

true if successful, false otherwise.

CleanUp()

Releases all resources and performs cleanup operations for this AAC encoder block. This method disposes of the GStreamer elements and resets the build state.

public void CleanUp()

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetCore()

Gets the core BaseElement wrapper that provides additional functionality around the GStreamer AAC encoder element.

public BaseElement GetCore()

Returns

BaseElement

The BaseElement wrapper instance that encapsulates the GStreamer AAC encoder.

GetDefaultSettings()

Gets the default AAC encoder settings appropriate for the current platform. On Windows, it prefers AVENC (libav) if available, otherwise falls back to Media Foundation. On Android and iOS (non-Catalyst), it uses the VO-AAC encoder. On all other platforms (Linux, macOS), it uses AVENC.

public static IAACEncoderSettings GetDefaultSettings()

Returns

IAACEncoderSettings

Platform-specific AAC encoder settings configured with default values.

GetElement()

Gets the underlying GStreamer element that performs the AAC encoding.

public Element GetElement()

Returns

Element

The GStreamer Element instance representing the AAC encoder.

IsAvailable(IAACEncoderSettings)

Determines whether this media block is available. Correct NuGet SDK redist should be included into your project.

public static bool IsAvailable(IAACEncoderSettings settings)

Parameters

settings IAACEncoderSettings

The settings.

Returns

bool

true if the specified settings is available; otherwise, false.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Associates this AAC encoder block with a pipeline and initializes its internal context. This method is called internally when the block is added to a pipeline.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The MediaBlocksPipeline instance that will manage this block.

See Also