Class DeviceMonitor
Capture device monitor and sound meter
public class DeviceMonitor : IDisposable
- Inheritance
-
DeviceMonitor
- Implements
- Inherited Members
Constructors
DeviceMonitor(string, AudioCaptureMode, bool[])
Creates new instance of DeviceMonitor
public DeviceMonitor(string audioDeviceId, AudioCaptureMode captureMode, bool[] channelFilter = null)
Parameters
audioDeviceIdstringAudio device to monitor
captureModeAudioCaptureModeCapture mode to use for monitoring
channelFilterbool[]Optional channel filter
DeviceMonitor(string, VideoCaptureMode)
Creates new instance of DeviceMonitor
public DeviceMonitor(string videoDeviceId, VideoCaptureMode captureMode)
Parameters
videoDeviceIdstringVideo device to monitor
captureModeVideoCaptureModeCapture mode to use for monitoring
DeviceMonitor(IAudioCaptureSource2, bool[], IReferenceClock)
Creates new instance of DeviceMonitor
public DeviceMonitor(IAudioCaptureSource2 audioSource, bool[] channelFilter = null, IReferenceClock referenceClock = null)
Parameters
audioSourceIAudioCaptureSource2Audio source to monitor
channelFilterbool[]Optional channel filter
referenceClockIReferenceClockOptional reference clock for meter synchronization
DeviceMonitor(IVideoCaptureSource2)
Creates new instance of DeviceMonitor
public DeviceMonitor(IVideoCaptureSource2 videoSource)
Parameters
videoSourceIVideoCaptureSource2Video source to monitor
DeviceMonitor(IMediaSource, int, IReferenceClock)
Creates new instance of DeviceMonitor
public DeviceMonitor(IMediaSource audioSource, int streamIndex, IReferenceClock referenceClock = null)
Parameters
audioSourceIMediaSourceAudio source to monitor
streamIndexintIndex of the audio stream to monitor
referenceClockIReferenceClockOptional reference clock for meter synchronization
Properties
CurrentChannelMeter
Gets the current meter levels for each individual channel.
public float[] CurrentChannelMeter { get; }
Property Value
- float[]
CurrentMeter
Gets the current averaged meter level across all monitored channels.
public float CurrentMeter { get; }
Property Value
CurrentState
Gets the current state of the capture device.
public CaptureDeviceState CurrentState { get; }
Property Value
DeviceId
Gets the identifier of the device being monitored.
public string DeviceId { get; }
Property Value
Methods
Dispose()
Releases all native resources associated with current object
public void Dispose()
Start()
Starts device monitor
public void Start()
Stop()
Stops device monitor
public void Stop()
Events
ChannelMeterUpdated
Channel meter has been updated. For audio devices invoked on regular basis for every captured frame. For video devices is never called.
public event EventHandler<float[]> ChannelMeterUpdated
Event Type
MeterUpdated
Meter has been updated. For audio devices invoked on regular basis for every captured frame. For video devices is never called.
public event EventHandler<float> MeterUpdated
Event Type
StateChanged
Device state changed. First time invoked on start and then only when device state changes.
public event EventHandler<CaptureDeviceState> StateChanged