ILMADet

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

Data Types:

AudDetStateConstants

typedef enum  
{ 
   AUDDET_STATE_STOPPED, 
   AUDDET_STATE_RUNNING, 
} AudDetStateConstants; 

List the possible values for the state of audio detection.

AUDDET_STATE_STOPPED The filter is not processing streaming data and the sound detection process is not running.
AUDDET_STATE_RUNNING The filter is processing streaming data and the sound detection process has started.

Interface Properties:

Type

Name

Description

ILMADetUserCallback

 

CallbackObj

(write-only) Sets the callback object pointer.

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

Set to NULL (or to "Nothing" in VB) in order to stop receiving notifications. (For example, before deleting the callback object interface).

VARIANT_BOOL

Enable

Enables or disables 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.

Set this depending on your microphone. Usually, a value between38 and 30 is used.

long

MinSilenceTime

The minimum length of silence periods (in milliseconds). Silences shorter than the MinSilenceTime are considered part of the sound. 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. 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. Note that if the Delay property has been set, sound detection does 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:

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.

IUnknown

CallbackObj2

(write-only) Sets 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 in order to stop receiving notifications. (For example, before deleting the callback object interface).

There are two types of callbacks that can be set:

  • ILMADetUserCallback uses variants, while

  • ILMADetUserCallback2 uses a pointer to the data cast as LONGLONG (__int64).

VB 6.0 or earlier users should use a ILMADetUserCallback interface, while C# and VB.NET users should use a ILMADetUserCallback2 interface.

C/C++ users can use either interface.

Interface Methods:

HRESULT StartDetection();

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.

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.

HRESULT StopDetection();

Description

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

The method succeeded.

VFW_E_WRONG_STATE

The filter is in the wrong state.

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Filters C API Help