Table of Contents

Class WASAPI2AudioCaptureDeviceSourceSettings

Namespace
VisioForge.Core.Types.X.Sources
Assembly
VisioForge.Core.dll

WASAPI2 audio capture device source settings.

public class WASAPI2AudioCaptureDeviceSourceSettings : IAudioCaptureDeviceSourceSettings, IVideoCaptureBaseAudioSourceSettings, IMediaBlockSettings, IAudioVolumeMute

Inheritance

Implements

Inherited Members

Constructors

WASAPI2AudioCaptureDeviceSourceSettings(AudioCaptureDeviceInfo, AudioCaptureDeviceFormat)

Initializes a new instance of the VisioForge.Core.Types.X.Sources.WASAPI2AudioCaptureDeviceSourceSettings class.

public WASAPI2AudioCaptureDeviceSourceSettings(AudioCaptureDeviceInfo device, AudioCaptureDeviceFormat format)

Parameters

device AudioCaptureDeviceInfo

The device.

format AudioCaptureDeviceFormat

The format.

Properties

API

Gets or sets the API.

public AudioCaptureDeviceAPI API { get; }

Property Value

AudioCaptureDeviceAPI

BufferTime

Gets or sets the size of the audio buffer held by the device, and the maximum latency the source reports. Larger values make capture tolerant of CPU spikes; smaller values reduce latency at the cost of dropped audio when the machine stalls. Set to Zero or a negative value to leave the element default untouched. The resolution is one microsecond; a smaller positive value is raised to it, and anything above 10 seconds is capped.

Has no effect when VisioForge.Core.Types.X.Sources.WASAPI2AudioCaptureDeviceSourceSettings.LowLatency is enabled, or when VisioForge.Core.Types.X.Sources.WASAPI2AudioCaptureDeviceSourceSettings.LoopbackMode selects a process loopback mode — that capture path is a virtual device with a fixed 20 ms period.

public TimeSpan BufferTime { get; set; }

Property Value

TimeSpan

Device

Gets or sets the name.

public AudioCaptureDeviceInfo Device { get; set; }

Property Value

AudioCaptureDeviceInfo

Format

Gets or sets the format.

public AudioCaptureDeviceFormat Format { get; set; }

Property Value

AudioCaptureDeviceFormat

LatencyTime

Gets or sets the minimum amount of data read in each iteration, and the minimum latency the source reports. Set to Zero or a negative value to leave the element default untouched. The resolution is one microsecond; a smaller positive value is raised to it, and anything above 10 seconds is capped.

public TimeSpan LatencyTime { get; set; }

Property Value

TimeSpan

Loopback

Gets or sets a value indicating whether to open the sink device for loopback recording.

public bool Loopback { get; set; }

Property Value

bool

LoopbackMode

Gets or sets the loopback mode. "LoopbackTargetPID" must be specified in case of process loopback modes. This option requires "Windows 10 build 20348" or later.

public WASAPI2SourceLoopbackMode LoopbackMode { get; set; }

Property Value

WASAPI2SourceLoopbackMode

LoopbackTargetPID

Gets or sets the loopback target process ID.

public uint LoopbackTargetPID { get; set; }

Property Value

uint

LowLatency

Gets or sets a value indicating whether to optimize all settings for lowest latency.

public bool LowLatency { get; set; }

Property Value

bool

Mute

Gets or sets a value indicating whether to mute audio.

public bool Mute { get; set; }

Property Value

bool

Volume

Gets or sets the volume of the stream.

public double Volume { get; set; }

Property Value

double

Methods

CreateBlock()

Creates the block.

public MediaBlock CreateBlock()

Returns

MediaBlock

MediaBlock.

GetMute()

Gets the mute.

public bool GetMute()

Returns

bool

true if successful, false otherwise.

GetVolume()

Gets the volume. Value should be in 0.0 - 1.0 range.

public double GetVolume()

Returns

double

System.Double.

IsSupported()

Determines whether this interface is supported.

public bool IsSupported()

Returns

bool

true if this interface is supported; otherwise, false.

SetInterface(IAudioVolumeMute)

Sets the interface.

public void SetInterface(IAudioVolumeMute intf)

Parameters

intf IAudioVolumeMute

The interface.

SetMute(bool)

Sets the mute.

public void SetMute(bool mute)

Parameters

mute bool

if set to true mute.

SetVolume(double)

Sets the volume. Value should be in 0.0 - 1.0 range.

public void SetVolume(double volume)

Parameters

volume double

The volume.