Table of Contents

Class AudioEffectsBlock

Namespace
VisioForge.Core.MediaBlocks.AudioProcessing
Assembly
VisioForge.Core.dll

Audio effects processing block that applies multiple real-time audio effects to audio streams. This block manages a chain of audio effects including volume control, equalizers, balance adjustment, echo/reverb, amplification, compression/expansion, and tempo scaling. Effects can be dynamically added, removed, and updated during playback without interrupting the audio stream. The block supports both real-time parameter adjustment and effect chaining for complex audio processing workflows. Essential for audio post-processing, music production, broadcast audio, and interactive audio applications. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class AudioEffectsBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

AudioEffectsBlock()

Initializes a new instance of the VisioForge.Core.MediaBlocks.AudioProcessing.AudioEffectsBlock class. Creates an audio effects processing block ready for effect configuration and audio processing. The block starts with no effects applied and can have effects added dynamically.

public AudioEffectsBlock()

Properties

AudioEffectsCount

Gets the number of audio effects currently configured in this block. This count includes all effects that have been added to the effects chain.

public int AudioEffectsCount { get; }

Property Value

int

Input

Gets the primary input pad for receiving audio to be processed with effects.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads for this audio effects block. This block has a single input for audio effects processing.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary output pad providing audio with applied effects.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads for this audio effects block. This block has a single output for effects-processed audio.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Type

Gets the block type identifier for audio effects processing.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

AddOrUpdate(BaseAudioEffect)

Adds a new audio effect to the processing chain or updates an existing effect with the same name. If an effect with the same name already exists, it will be replaced with the new configuration. Effects can be added dynamically during playback, and the block will reconfigure the processing chain to include the new effect. The effect will be automatically initialized and configured.

public void AddOrUpdate(BaseAudioEffect effect)

Parameters

effect BaseAudioEffect

The audio effect to add or update in the processing chain.

Remarks

Supported audio effects include:

  • Volume control and amplification
  • Stereo balance adjustment
  • Echo and reverb effects
  • Multi-band and parametric equalizers
  • Audio compression and expansion
  • Tempo scaling without pitch change Effects are applied in the order they were added to the chain.

Build()

Builds and initializes the audio effects block by creating the audio processing chain. This method sets up the audio converter, initializes the effects processor, and configures the effects chain based on the currently added effects. Effects are linked in sequence to create a processing pipeline that applies all effects to the audio stream.

public override bool Build()

Returns

bool

true if the audio effects block was successfully built and configured; false if initialization failed.

CleanUp()

Cleans up the audio effects block by disposing of all internal processing components. This method safely releases the audio effects processor, audio converter, and resets the block to an unbuilt state for potential reuse or final disposal.

public void CleanUp()

Clear()

Removes all audio effects from the processing chain. This method clears both the high-level effects list and the underlying GStreamer processing elements, returning the block to a pass-through state with no effects applied.

public void Clear()

Dispose(bool)

Releases unmanaged and optionally managed resources used by the audio effects block. Properly disposes of all audio effects, the effects processor, and audio converter components.

protected override void Dispose(bool disposing)

Parameters

disposing bool

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

Get(string)

Retrieves an audio effect from the processing chain by its name. This method allows access to individual effects for parameter adjustment or configuration. The search is case-insensitive for convenience.

public BaseAudioEffect Get(string name)

Parameters

name string

The name of the audio effect to retrieve, as specified during creation.

Returns

BaseAudioEffect

The VisioForge.Core.Types.X.AudioEffects.BaseAudioEffect instance with the specified name, or null if not found.

GetCore()

Gets the core GStreamer base element for this audio effects block. Returns null as this block manages multiple internal elements rather than a single core element.

public BaseElement GetCore()

Returns

BaseElement

Null, as this block is a composite of multiple audio effect elements.

GetElement()

Gets the underlying GStreamer element for direct GStreamer API access. Returns null as this block manages multiple internal elements in a processing chain.

public Element GetElement()

Returns

Element

Null, as this block contains multiple GStreamer elements for different effects.

IsAvailable()

Determines whether the audio effects block is available in the current environment. Audio effects processing is generally available with the core SDK components. The correct NuGet SDK redistribution package should be included in your project.

public static bool IsAvailable()

Returns

bool

true if audio effects processing is available; otherwise, false.

Remove(BaseAudioEffect)

Removes an audio effect from the processing chain. This method safely removes the effect from both the high-level effect list and the underlying GStreamer processing chain, cleaning up resources and event handlers.

public void Remove(BaseAudioEffect effect)

Parameters

effect BaseAudioEffect

The audio effect to remove from the processing chain.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this audio effects block. This method is called internally by the MediaBlocks pipeline during block initialization to provide access to pipeline resources, logging context, and effect processor configuration.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent MediaBlocksPipeline that owns this block.

See Also