
Description | Cautions | Example | Errors | See Also
Name: |
int dx_addvoldig(chdev,digit,adjval) | |
Inputs: |
int chdev |
|
char digit |
| |
short adjval |
| |
Returns: |
0 if success | |
-1 if failure | ||
Includes: |
srllib.h | |
Category: |
Speed and Volume Convenience | |
The dx_addvoldig( ) function is a convenience function that sets a DTMF digit to adjust volume by a specified amount, immediately and for all subsequent plays on the specified channel (until changed or cancelled).
This function assumes that the Volume Modification Table has not been modified using the dx_setsvmt( ) function.
For information about the speed and volume functions and the Speed and Volume Modification Tables, see the Voice Software Reference: Voice Features Guide.
Parameter |
Description | |
chdev |
specifies the valid channel device handle obtained by a call to dx_open( ). | |
digit |
specifies a DTMF digit (0-9, *,#) that will modify volume by the amount specified in adjval. | |
To start play-volume at the origin, set digit to NULL and set adjval to SV_NORMAL. | ||
adjval |
specifies one of the following the speed adjustment values to take effect whenever the digit specified in digit occurs: | |
|
SV_ADD2DB |
Increase play-volume by 2DB | |
SV_ADD4DB |
Increase play-volume by 4DB | |
SV_ADD6DB |
Increase play-volume by 6DB | |
SV_ADD8DB |
Increase play-volume by 8DB | |
SV_SUB2DB |
Decrease play-volume by 2DB | |
SV_SUB4DB |
Decrease play-volume by 4DB | |
SV_SUB6DB |
Decrease play-volume by 6DB | |
SV_SUB8DB |
Decrease play-volume by 8DB | |
SV_NORMAL |
Set play-volume to origin when the play begins (digit must be set to NULL) | |
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
/*
* Global Variables
*/
main()
{
int dxxxdev;
/*
* Open the Voice Channel Device and Enable a Handler
*/
if ( ( dxxxdev = dx_open( "dxxxB1C1", NULL) ) == -1 ) {
perror( "dxxxB1C1" );
exit( 1 );
}
/*
* Add a Speed Adjustment Condition - decrease the
* playback volume by 2dB whenever DTMF key 2 is pressed. */
if ( dx_addvoldig( dxxxdev, '2', SV_SUB2DB ) == -1 ) {
printf( "Unable to Add a Volume Adjustment" );
printf( " Condition\n");
printf( "Lasterror = %d Err Msg = %s\n",
ATDV_LASTERR( dxxxdev ), ATDV_ERRMSGP( dxxxdev ) );
dx_close( dxxxdev );
exit( 1 );
}
/*
* Continue Processing
* .
* .
* .
*/
/*
* Close the opened Voice Channel Device
*/
if ( dx_close( dxxxdev ) != 0 ) {
perror( "close" );
}
/* Terminate the Program */
exit( 0 );
}
If this function returns -1 to indicate failure, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following error reasons:
|
EDX_BADPARM |
|
EDX_BADPROD |
|
EDX_SVADJBLKS |
|
EDX_SYSTEM |
|
Related Speed and Volume functions:
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation