TAPIEx ActiveX Control v3.6

MonitorTonesEx_Add

The MonitorTonesEx_Add method enables the detection of inband tones on this call. Each time when a specified tone is detected, OnToneDetected will be fired. It is the Software Simulation edition of MonitorTones_Add method.

MonitorTonesEx_Add method only add tone entry. Must use Record("MONITOR:TONES") to start the monitor. Use the MonitorTones_Clear method to clear the tone entries.

Function MonitorTones_Add(
AppSpecific As Long,
MinPeriodOn As Long,
MinPeriodOff As Long,   
[Frequency1 As Long],[Frequency2 As Long], [Frequency3 As Long], [Frequency4 As Long], 
[MinAmpdB As Single],
[MaxAmpdB As Single] 
) As Boolean

Parameters

AppSpecific
Used by the application for tagging the tone. When this tone is detected, Event OnToneDetected() fires with the value of the AppSpecific as parameter.
MinPeriodOn
The minimal duration of the period on in milliseconds, during which the tone should be present before a detection is made.
MinPeriodOff
The minimal duration of the period off in milliseconds, during which the tone should be present before a detection is made. Leave it zero to ignore this parameter.
Frequency1, Frequency2, Frequency3
The frequency, in hertz, of a component of the tone. If fewer than three frequencies are needed in the tone, a value of 0 should be used for the unused frequencies. A tone with all three frequencies set to zero is interpreted as silence and can be used for silence detection. If FrequencyX is negative, it works as negation gate. For more info, read the example below.
MinAmpdB
The minimal amplitude (dB) threshold, range from -1dB to -60dB . Ignore this parameter if it is zero.
MaxAmpdB
The maximal amplitude (dB) threshold, range from -1dB to -60dB . Ignore this parameter if it is zero.

Return Values

If the method succeeds, return TRUE. If the function fails, the return value is FALSE.

Remarks

For more info about how to use this method, please refer our "Monitor Tones" demo sample.

Example:

        ' Decode the '0'-'#'  DTMF keys
        .MonitorTones_Add 1, 80, 80, 697, 1209, 0      ' "1"
        .MonitorTones_Add 2, 80, 80, 697, 1336, 0      ' "2"
        .MonitorTones_Add 3, 80, 80, 697, 1477, 0      ' "3"
        .MonitorTones_Add 4, 80, 80, 770, 1209, 0      ' "4"
        .MonitorTones_Add 5, 80, 80, 770, 1336, 0      ' "5"
        .MonitorTones_Add 6, 80, 80, 770, 1477, 0      ' "6"
        .MonitorTones_Add 7, 80, 80, 852, 1209, 0      ' "7"
        .MonitorTones_Add 8, 80, 80, 852, 1336, 0      ' "8"
        .MonitorTones_Add 9, 80, 80, 852, 1477, 0      ' "9"
        .MonitorTones_Add 10, 80, 80, 941, 1209, 0     ' "*"
        .MonitorTones_Add 0,  80, 80, 941, 1336, 0     ' "0"
        .MonitorTones_Add 12, 80, 80, 941, 1477, 0     ' "#"
       ITAPICall.Record("MONITOR:TONES")           'Start the monitoring 

  .MonitorTones_Add  1, 500, 500, 480, 620, 0,  0,  -20      '  Monitor the 480Hz, 620Hz dual tone and it amplitude must >-20dB
  .MonitorTones_Add  1, 500, 500, 350, 440, 0, -40, -12      '  Monitor the 350Hz, 440Hz dual tone and it amplitude must  in range  -12dB to -40dB
  .MonitorTones_Add  1, 500, 500, 350, 440, 0, -20,   0      '  Monitor the 350Hz, 440Hz dual tone and it amplitude must  < -20dB 
  
  ' use feature of negation gate : 
  .MonitorTones_Add  1, 50, 50, -450			      ' Monitor the non 450Hz signal (OnToneDetected will be fired if the signal neither in 450Hz nor silence for 50ms.)
  .MonitorTones_Add  1, 50, 50, 480, -620		            ' Monitor the 480Hz and non 620Hz signal 

  ITAPICall.Record("MONITOR:TONES")           'Start the monitoring 

See Also

OnToneDetected , MonitorTones_Add, Record