Previous PageTable Of ContentsHomeIndexNext Page


5.3. Global Tone Generation (GTG)

Global Tone Generation enables the creation of user-defined tones. The Tone Generation template, TN_GEN, is used to define the tones with the following information:

The following functions are used to generate tones:

dx_bldtngen( )

  build a tone generation template

dx_playtone( )

  play a tone

dx_bldtngen( ) is a convenience function that sets up the tone generation template data structure (TN_GEN) by allowing the assignment of specified values to the appropriate fields. The tone generation template is placed in the user's return buffer and can then be used by the dx_playtone( ) function to generate the tone.

dx_playtone( ) plays a tone specified by the tone generation template (pointed to by tngenp). Termination conditions are set using the DV_TPT structure. The reason for termination is returned by the ATDX_TERMMSK( ) function. dx_playtone( ) returns a 0 to indicate that it has completed successfully.

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. Use dx_playtone( ) to play the tone.

The TN_GEN data structure is shown below:

After you build the TN_GEN data structure, there are two ways to define each tone template:

    1. Include the values in the structure, or
    2. Pass the values to TN_GEN using the dx_bldtngen( ) function.

After defining the template, pass TN_GEN to dx_playtone( ) to play the tone.

If you include the values in the structure, you must create a structure for each tone template. If you pass the values using the dx_playtone( ) function, then you can reuse the structure. If you are only changing one value in a template with many variables, it may be more convenient to use several structures in the code instead of reusing just one.


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2001, Dialogic Corporation
All rights reserved
This page generated January, 2001