Intel 05-1832-002 IP Phone User Manual


 
530 Voice API for Windows Operating Systems Library Reference — November 2003
TN_GEN — tone generation template
TN_GEN
tone generation template
typedef struct {
unsigned short tg_dflag; /* Dual Tone - 1, Single Tone - 0 */
unsigned short tg_freq1; /* Frequency for Tone 1 (HZ) */
unsigned short tg_freq2; /* Frequency for Tone 2 (HZ) */
short tg_ampl1; /* Amplitude for Tone 1 (dB) */
short tg_ampl2; /* Amplitude for Tone 2 (dB) */
short tg_dur; /* Duration of the Generated Tone */
/* Units = 10 msec */
} TN_GEN;
!
!!
! Description
The TN_GEN data structure contains parameters for the tone generation template.
The tone generation template defines the frequency, amplitude, and duration of a single- or dual-
frequency tone to be played. You can use the convenience function dx_bldtngen( ) to set up the
structure for the user-defined tone. Use dx_playtone( ) to play the tone.
!
!!
! Field Descriptions
The fields of the TN_GEN data structure are described as follows:
tg_dflag
Tone Generation Dual Tone Flag: Flag indicating single- or dual-tone definition. If single, the
values in tg_freq2 and tg_ampl2 will be ignored.
TN_SINGLE – single tone
TN_DUAL – dual tone
tg_freq1
specifies the frequency for tone 1 in Hz (range: 200 to 2000 Hz)
tg_freq2
specifies the frequency for tone 2 in Hz (range: 200 to 2000 Hz)
tg_ampl1
specifies the amplitude for tone 1 in dB (range: -40 to 0 dB)
tg_ampl2
specifies the amplitude for tone 2 in dB (range: -40 to 0 dB)
tg_dur
specifies the duration of the tone in 10 msec units; -1 = infinite duration
!
!!
! Example
For an example of how to use the TN_GEN structure, see the Example section for dx_bldtngen( ).