Class PulseAudioSourceBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sources
- Assembly
- VisioForge.Core.dll
PulseAudio source block for audio capture using the pulsesrc GStreamer element. Provides audio capture from PulseAudio sound server on Linux systems for recording, streaming, and real-time audio processing applications. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class PulseAudioSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IAudioVolumeMuteInheritance
Implements
Inherited Members
Extension Methods
Constructors
PulseAudioSourceBlock(PulseAudioSourceSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.PulseAudioSourceBlock class with custom capture settings. Configures the PulseAudio source for microphone or line-in capture with specified parameters.
public PulseAudioSourceBlock(PulseAudioSourceSettings settings)Parameters
settingsPulseAudioSourceSettings-
The PulseAudio capture settings controlling device selection and format parameters.
Properties
Input
Gets the primary input pad (none for source blocks that capture from devices).
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 captured audio stream.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (single audio output for microphone).
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the PulseAudio capture settings that control device selection and audio parameters.
public PulseAudioSourceSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier for PulseAudio source operations.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the PulseAudio source within the pipeline context. Creates PulseAudio capture source, configures device parameters, and prepares audio output for downstream processing.
public override bool Build()Returns
- bool
-
trueif the PulseAudio source was successfully built and configured; otherwise,false.
CleanUp()
Cleans up all resources associated with the audio capture operations, including device handles and audio buffers.
public void CleanUp()Dispose(bool)
Releases unmanaged and managed resources used by the PulseAudio source. Properly closes audio device handles and disposes of GStreamer elements and capture 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 PulseAudio source GStreamer element.
GetMute()
Gets the current mute state of the audio capture device.
public bool GetMute()Returns
- bool
-
trueif the audio capture is muted;falseif unmuted.
GetVolume()
Gets the current capture volume level of the audio device.
public double GetVolume()Returns
- double
-
The volume level as a double in the range 0.0 (silence) to 1.0 (maximum volume).
IsAvailable()
Determines whether PulseAudio capture support is available on the current system. Requires PulseAudio GStreamer plugin to be available and functional.
public static bool IsAvailable()Returns
- bool
-
trueif PulseAudio capture support is available; otherwise,false.
IsSupported()
Determines whether volume and mute control is supported by the current audio capture device.
public bool IsSupported()Returns
- bool
-
trueif volume/mute control is supported; otherwise,false.
SetInterface(IAudioVolumeMute)
Sets the audio volume/mute interface for internal use by the framework.
public void SetInterface(IAudioVolumeMute intf)Parameters
intfIAudioVolumeMute-
The IAudioVolumeMute interface implementation.
SetMute(bool)
Sets the mute state of the audio capture device.
public void SetMute(bool mute)Parameters
mutebool-
If set to
true, mutes the audio capture; otherwise, unmutes it.
SetVolume(double)
Sets the capture volume level for the audio device.
public void SetVolume(double volume)Parameters
volumedouble-
The volume level in the range 0.0 (silence) to 1.0 (maximum volume).
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this PulseAudio source, providing access to the parent pipeline and logging context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this PulseAudio source.