Class HRTFRenderBlock
- 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, IMediaBlockInternalsInheritance
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
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
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
Input
Gets the input.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the inputs.
public override MediaBlockPad[] Inputs { get; }Property Value
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
Output
Gets the output.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the outputs.
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the type.
public override MediaBlockType Type { get; }Property Value
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
-
trueif the filter was successfully built and configured;falseif 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
disposingbool-
trueto release both managed and unmanaged resources;falseto 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
-
trueif 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
pipelineMediaBlocksPipeline-
The MediaBlocksPipeline instance that will manage this block.