ILMADet Interface

This is the interface for the LEAD Audio Detection Filter (2.0).

Interface Properties:

Type

Property name

Description

ILMADetUserCallback

 

CallbackObj

(write-only) Set the callback object pointer.

If not NULL, the CallbackProc method of this interface will be called to report audio detection events.

Set to NULL (or to "Nothing" in VB) if you do not wish to receive notifications anymore. (For example, before you delete the callback object interface).

VARIANT_BOOL

Enable

Enable/Disable audio detection. Set to TRUE to enable audio detection and receive event notifications.

long

Threshold

The threshold (in dB) used to detect sound. The allowed range is –40 to 0.

–40 is equivalent to absolute silence and 0 is the loudest possible sound. All sounds below this threshold are considered silence.

You set this depending on your microphone. Usually, a value between–38 and –30 is used.

long

MinSilenceTime

The minimum length of silence periods (in milliseconds). Silences shorter than MinSilenceTime will be considered part of the sound. You want to set this value so short pauses do not trigger false silences. Most conversations contain short silences while the people talking draw their breath or pause while they are thinking.

long

LeftLevel

(read-only) The intensity (power) of the signal in the left channel (in dB).

Note: If the audio stream is mono, the values of LeftLevel and RightLevel are the same.

long

RightLevel

(read-only) The intensity (power) of the signal in the right channel (in dB).

Note: If the audio stream is mono, the values of LeftLevel and RightLevel are the same.

long

Interval

The time intervals at which the filter will check the stream for audio data. This value is in milliseconds.

long

Delay

The amount of time the filter waits before it starts checking the stream for sound data (sound detection). This value is in milliseconds.

VARIANT_BOOL

AutoStart

Flag that indicates whether to start sound detection when streaming starts or not. Set this to VARIANT_TRUE to have the filter start sound detection when streaming starts. Set this to VARIANT_FALSE to start sound detection manually. Please note that if the Delay property has been set, sound detection will not begin, regardless of the value of AutoStart, until the delay period has elapsed.

AudDetStateConstants

State

(read only) Indicates the state of audio detection. Possible values are:

 

 

Value

Meaning

 

 

AUDDET_STATE_RUNNING

The filter is processing streaming data and the sound detection process has started.

 

 

AUDDET_STATE_STOPPED

The filter is not processing streaming data and the sound detection process is not running.

Interface Methods:

HRESULT StartDetection();

Returns

S_OK

The method succeeded.

VFW_E_NOT_CONNECTED

An error has occurred, either the input or output pin is not connected.

VFW_E_NOT_RUNNING

The filter in not in the running state.

Comments

This method starts sound detection manually. If the Delay property has been set, sound detection will not begin until the delay period has elapsed.

To have the filter automatically start sound detection when streaming starts, set the AutoStart property to VARIANT_TRUE and do not call this method. Again, even if AutoStart is set to VARIANT_TRUE, if the Delay property has been set, sound detection will not begin until the delay period has elapsed.

HRESULT StopDetection();

Stops sound detection.

Returns

S_OK

The method succeeded.

VFW_E_NOT_CONNECTED

An error has occurred, either the input or output pin is not connected.

 

HRESULT ResetToDefaults()

 

Description:

Resets the filter properties to their default values. Calling this method might cause the filter to reconnect its output pin.

 

Comments:

The method will fail if the filter is in the running state.

 

Returns:

S_OK 

Success

VFW_E_WRONG_STATE

The filter is in the wrong state.