Table of Contents

Class VirtualAudioSourceBlock

Namespace
VisioForge.Core.MediaBlocks.Sources
Assembly
VisioForge.Core.dll

Virtual audio source block for synthetic audio generation and testing purposes. Provides programmable audio waveform generation including sine waves, square waves, white noise, and silence for audio testing, calibration, signal processing development, and placeholder audio in multimedia applications. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class VirtualAudioSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

VirtualAudioSourceBlock(VirtualAudioSourceSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.VirtualAudioSourceBlock class with custom audio generation settings. Configures the virtual audio source for synthetic waveform generation with specified parameters.

public VirtualAudioSourceBlock(VirtualAudioSourceSettings settings)

Parameters

settings VirtualAudioSourceSettings

The virtual audio settings controlling waveform type, frequency, volume, and format parameters.

VirtualAudioSourceBlock()

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.VirtualAudioSourceBlock class with default settings. Creates a virtual audio source with standard sine wave generation at default frequency and volume.

public VirtualAudioSourceBlock()

VirtualAudioSourceBlock(VirtualAudioSourceSettingsWave)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.VirtualAudioSourceBlock class with specified waveform type. Creates a virtual audio source generating the specified waveform at default frequency and volume.

public VirtualAudioSourceBlock(VirtualAudioSourceSettingsWave wave)

Parameters

wave VirtualAudioSourceSettingsWave

The type of audio waveform to generate (sine, square, saw, triangle, silence, white noise, etc.).

Properties

Input

Gets the primary input pad (none for source blocks that generate audio).

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads available on this block (none for source blocks).

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary audio output pad for the generated audio stream.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads available on this block (single audio output).

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the virtual audio configuration settings that control waveform generation parameters.

public VirtualAudioSourceSettings Settings { get; set; }

Property Value

VirtualAudioSourceSettings

Type

Gets the media block type identifier for virtual audio source operations.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the virtual audio source within the pipeline context. Configures waveform generation, establishes audio processing chain, and prepares audio output for downstream processing.

public override bool Build()

Returns

bool

true if the virtual audio source was successfully built and configured; otherwise, false.

CleanUp()

Cleans up all resources associated with the virtual audio operations, including waveform generators and audio buffers.

public void CleanUp()

Dispose(bool)

Releases unmanaged and managed resources used by the virtual audio source. Properly stops audio generation and disposes of GStreamer elements and audio processing 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 GStreamer element wrapper for advanced configuration and monitoring.

public BaseElement GetCore()

Returns

BaseElement

Always null for composite source blocks with multiple internal elements.

GetElement()

Gets the native GStreamer element for direct GStreamer pipeline integration.

public Element GetElement()

Returns

Element

The virtual audio source GStreamer element.

IsAvailable()

Determines whether virtual audio support is available on the current system. Requires GStreamer audio test source plugins to be installed and functional.

public static bool IsAvailable()

Returns

bool

true if virtual audio support is available; otherwise, false.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this virtual audio source, providing access to the parent pipeline and logging context.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent MediaBlocks pipeline containing this virtual audio source.

See Also