Table of Contents

Class HRTFRenderBlock

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

Head-Related Transfer Function (HRTF) spatial audio rendering block using hrtfrender from rsaudiofx plugin. Renders spatial audio using HRTF data for 3D positional audio effects. Provides immersive audio experiences by simulating how sound reaches the ears from different spatial positions. Essential for VR applications, games, and spatial audio content production. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class HRTFRenderBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

HRTFRenderBlock()

Initializes a new instance of the VisioForge.Core.MediaBlocks.AudioProcessing.HRTFRenderBlock class with default HRTF rendering settings.

public HRTFRenderBlock()

Properties

BlockLength

Gets or sets the block length for processing. Determines the size of audio blocks processed at once. Larger blocks may reduce CPU usage but increase latency. Default: 512.

public ulong BlockLength { get; set; }

Property Value

ulong

DistanceGain

Gets or sets the distance gain factor. Controls how distance affects the audio volume in spatial positioning. Higher values make distance more pronounced, lower values reduce distance effects. Default: 1.0.

public float DistanceGain { get; set; }

Property Value

float

HrirFile

Gets or sets the path to the HRIR (Head-Related Impulse Response) file. This file contains the spatial audio data for HRTF rendering. Must be set to a valid HRIR file for proper spatial audio rendering.

public string HrirFile { get; set; }

Property Value

string

Input

Gets the input.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets the inputs.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

InterpolationSteps

Gets or sets the number of interpolation steps. Higher values provide smoother transitions between spatial positions but use more CPU. Default: 8.

public ulong InterpolationSteps { get; set; }

Property Value

ulong

Output

Gets the output.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets the outputs.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Type

Gets the type.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Constructs and initializes the HRTF rendering filter and its associated GStreamer elements. This method creates the filter with the specified spatial rendering parameters, establishes input and output pads, and prepares the block for rendering spatial audio using HRTF data.

public override bool Build()

Returns

bool

true if the filter was successfully built and configured; false if initialization failed.

CleanUp()

Releases all resources and performs cleanup operations for this HRTF rendering 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 HRTF rendering filter element.

public BaseElement GetCore()

Returns

BaseElement

The BaseElement wrapper instance that encapsulates the GStreamer HRTF rendering filter.

GetElement()

Gets the underlying GStreamer element that performs the HRTF spatial audio rendering.

public Element GetElement()

Returns

Element

The GStreamer Element instance representing the HRTF rendering filter.

IsAvailable()

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

public static bool IsAvailable()

Returns

bool

true if this media block is available; otherwise, false.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Associates this HRTF rendering 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