
Description | Cautions | Example | Errors | See Also
Name: |
int dx_addspddig( chdev, digit, adjval) | |
Inputs: |
int chdev |
|
char digit |
| |
short adjval |
| |
Returns: |
0 if success | |
Includes: |
srllib.h | |
Category: |
Speed and Volume Convenience | |
The dx_addspddig( ) function is a convenience function that sets a DTMF digit to adjust speed by a specified amount, immediately and for all subsequent plays on the specified channel (until changed or cancelled).
This function assumes that the Speed Modification Table has not been modified using the dx_setsvmt( ) function.
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 speed by the amount specified in adjval. | |
To start play-speed 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_ADD10PCT |
Increase play - speed by 10% | |
SV_ADD20PCT |
Increase play - speed by 20% | |
SV_ADD30PCT |
Increase play - speed by 30% | |
SV_ADD40PCT |
Increase play - speed by 40% | |
SV_ADD50PCT |
Increase play - speed by 50% | |
SV_SUB10PCT |
Decrease play - speed by 10% | |
SV_SUB20PCT |
Decrease play - speed by 20% | |
SV_SUB30PCT |
Decrease play - speed by 30% | |
SV_SUB40PCT |
Decrease play - speed by 40% | |
SV_NORMAL |
Set play - speed to origin (regular speed) 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 - increase the
* playback speed by 30% whenever DTMF key 1 is pressed.
*/
if ( dx_addspddig( dxxxdev, '1', SV_ADD30PCT ) == -1 ) {
printf("Unable to Add a Speed Adjustment 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_SYSTEM |
|
EDX_SVADJBLK |
|
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation