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, IMediaBlockInternalsInheritance
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
settingsVirtualAudioSourceSettings-
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
waveVirtualAudioSourceSettingsWave-
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
Inputs
Gets all input pads available on this block (none for source blocks).
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary audio output pad for the generated audio stream.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (single audio output).
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the virtual audio configuration settings that control waveform generation parameters.
public VirtualAudioSourceSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier for virtual audio source operations.
public override MediaBlockType Type { get; }Property Value
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
-
trueif 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
disposingbool-
trueto release both managed and unmanaged resources;falseto 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
-
trueif 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
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this virtual audio source.