Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 531
cadenced tone generation template — TN_GENCAD
TN_GENCAD
cadenced tone generation template
typedef struct {
unsigned char cycles; /* Number of cycles */
unsigned char numsegs; /* Number of tones */
short offtime[4]; /* Array of off-times */
/* one for each tone */
TN_GEN tone[4]; /* Array of tone templates */
} TN_GENCAD;
!
!!
! Description
The TN_GENCAD data structure contains parameters for the cadenced tone generation template. It
defines a cadenced tone that can be generated by using the dx_playtoneEx( ) function.
TN_GENCAD defines a signal by specifying the repeating elements of the signal (the cycle) and
the number of desired repetitions. The cycle can contain up to 4 segments, each with its own tone
definition and on/off duration, which creates the signal pattern or cadence. Each segment consists
of a TN_GEN single- or dual-tone definition (frequency, amplitude, & duration) followed by a
corresponding off-time (silence duration) that is optional. The dx_bldtngen( ) convenience
function can be used to set up the TN_GEN components of the TN_GENCAD structure. The
segments are seamlessly concatenated in ascending order to generate the signal cycle.
TN_GENCAD is defined in dxxxlib.h.
!
!!
! Field Descriptions
The fields of the TN_GENCAD data structure are described as follows:
cycles
The cycles field specifies the number of times the cycle will be played.
On DM3 boards, valid values are 1 to 40 cycles.
On Springware boards, valid values are from 1 to 255 (255 = infinite repetitions).
numsegs
The numsegs field specifies the number of segments used in the cycle, from 1 to 4. A segment
consists of a tone definition in the tone[ ] array plus the corresponding off-time in the
offtime[ ] array. If you specify less than four segments, any data values in the unused segments
will be ignored (if you specify two segments, the data in segments 3 and 4 will be ignored).
The segments are seamlessly concatenated in ascending order to generate the cycle.
offtime[4]
The offtime[ ] array contains four elements, each specifying an off-time (silence duration) in
10 msec units that corresponds to a tone definition in the tone[ ] array. The offtime[ ] element
is ignored if the segment is not specified in numsegs.
The off-times are generated after the tone on-time (TN_GEN tg_dur), and the combination of
tg_dur and offtime produce the cadence for the segment. Set the offtime = 0 to specify no off-
time for the tone.