Previous PageTable Of ContentsHomeIndexNext Page

lm_LearnTone( )

Description | Cautions | Errors | Example | See Also

Name:

long lm_LearnTone(cd, lm_parmp, tn_amplp, dflagp, tn_rangep, tn_tonep, tn_infop, mode)

Inputs:

int cd

  channel device handle

 

LM_PARM *lm_parmp

  pointer to the LM_PARM structure

 

TN_AMP *tn_amplp

  pointer to the TN_AMP structure

 

short *dflagp

  pointer to single/dual tone flag

 

TN_DESC *tn_rangep

  pointer to the TN_DESC structure specifying an optional learning range

 

TN_DESC *tn_tonep

  pointer to the TN_DESC structure specifying the tone description

 

TN_INFOLIST *tn_infolistp

  pointer to the TN_INFOLIST structure

 

int mode

  synchronous

Outputs:

none

Returns:

0 if success
-1 if failure

 

Includes:

srllib.h

dxxxlib.h

lmodelib.h

Mode:

synchronous

Category:

learn mode

Platform:

Springware

Top Of PageDescription

The lm_LearnTone( ) function initiates learn mode to characterize a tone that occurs on the specified channel and to obtain the complete tone description for use with global tone detection or call progress analysis. For more information on global tone detection and call progress analysis, see the Voice Software Reference -- Features Guide.

Parameter

Description

cd

Specifies the channel device handle.

lm_parmp

Points to the LM_PARM data structure which specifies parameters used to characterize the tone. For more information, see the LM_PARM structure in Chapter 6.  Data Structure Reference.

tn_amplp

Points to the TN_AMP data structure. This specifies tone amplitude boundaries that restrict the learning to a specified amplitude range. For example, you can set the amplitude range lower to learn a poor quality tone, although noise may interfere with the results, or you can set the amplitude range higher to detect a high-quality tone. For more information, see TN_AMP structure in Chapter 6.  Data Structure Reference.

dflagp

Specifies the single/dual tone flag, which indicates whether the tone is a single tone or dual tone. This flag must be set manually. When you set this flag manually, make sure you take the voice board dual-tone resolution into account.

 

0

If unknown or new tone

 

1

single tone (or a dual tone that falls below the dual-tone resolution)

 

2

dual tone

tn_rangep

Points to the TN_DESC data structure specifying optional tone learning boundaries to restrict learning to the specified range. For more information, see TN_DESC structure in Chapter 6.  Data Structure Reference.

If you set tn_rangep to NULL, this feature is disabled.

tn_tonep

Points to the TN_DESC data structure specifying the tone description.

This parameter serves two different purposes: (1) it specifies an existing tone description as optional input to the lm_LearnTone( ) function, and learn mode incorporates this input into the final tone description, and (2) it provides the final tone description that is returned by lm_LearnTone( ).

See Requirements section for more information on using this parameter.

tn_infolistp

Points to the TN_INFOLIST structure which contains an array of tone information (TN_INFO data structure). This structure provides the actual frequency and on/off times for each frame (sample) of a detected tone. This information is used primarily for debugging.

 

If you set tn_infolistp to NULL, this feature is disabled, and the data is not available for your analysis.

 

If you want to analyze the data on which learn mode bases the final tone description, you must allocate an array of memory for saving the tone information of each sample. The required memory is equal to the number of lm_frames (stored in LM_PARM structure) + OFFSET (defined in lmodelib.h) multiplied by the size of the TN_INFO structure. OFFSET allows the library to store tone information for extra frames. The tn_infolistp parameter is also used to learn disconnect tones with more than one on time and more than one off time.

mode

You must set the mode to EV_SYNC for synchronous operation.

Requirements

Top Of PageCautions

Top Of PageErrors

For a list of error codes, see Section 5.2.  Learn Mode Error Codes.

Top Of PageExample

Top Of PageSee Also


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated January, 2003