
Description | Cautions | Example | Errors | See Also
Name: |
int dx_setsvmt(chdev,tabletype,svmtp,flag) | |
Inputs: |
int chdev |
|
unsigned short tabletype |
| |
DX_SVMT * svmtp |
| |
unsigned short flag |
| |
Returns: |
0 if success | |
-1 if failure | ||
Includes: |
srllib.h | |
dxxxlib.h | ||
Category: |
Speed and Volume | |
The dx_setsvmt( ) function updates the speed or volume Speed/Volume Modification Table for a channel, with the values contained in a specified DX_SVMT structure.
This function can also modify the Speed or Volume Modification Table to do one of the following:
Parameter |
Description | |
|
chdev |
specifies the valid channel device handle obtained by a call to dx_open( ). | |
|
tabletype |
specifies whether to retrieve the Speed or the Volume Modification Table. | |
|
SV_SPEEDTBL |
Update the Speed Modification Table values | |
SV_VOLUMETBL |
Update the Volume Modification Table values | |
svmtp |
points to the DX_SVMT structure whose contents are used to update either the speed or the volume Speed/Volume Modification Table. | |
This structure is not used when SV_SETDEFAULT has been set in the mode parameter. | ||
flag |
specifies one of the following: | |
|
SV_WRAPMOD |
Wrap around the speed or volume adjustments that occur at the top or bottom of the Speed/Volume Modification Table. | |
|
SV_SETDEFAULT |
Reset the table to its default values. See the Voice Software Reference: Voice Features Guide for the default values of the table. | |
|
In this case, the DX_SVMT pointed to by svmtp is ignored | ||
| ||
None.
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
/*
* Global Variables
*/
main()
{
DX_SVMT svmt;
int dxxxdev, index;
/*
* Open the Voice Channel Device and Enable a Handler
*/
if ( ( dxxxdev = dx_open( "dxxxB1C1", NULL) ) == -1 ) {
perror( "dxxxB1C1" );
exit( 1 );
}
/*
* Set up the Speed/Volume Modification
*/
memset( &svmt, 0, sizeof( DX_SVMT ) );
svmt.decrease[ 0 ] = -128;
svmt.decrease[ 1 ] = -128;
svmt.decrease[ 2 ] = -128;
svmt.decrease[ 3 ] = -128;
svmt.decrease[ 4 ] = -128;
svmt.decrease[ 5 ] = -20;
svmt.decrease[ 6 ] = -16;
svmt.decrease[ 7 ] = -12;
svmt.decrease[ 8 ] = -8;
svmt.decrease[ 9 ] = -4;
svmt.origin = 0;
svmt.increase[ 0 ] = 4;
svmt.increase[ 1 ] = 8;
svmt.increase[ 2 ] = 10;
svmt.increase[ 3 ] = -128;
svmt.increase[ 4 ] = -128;
svmt.increase[ 5 ] = -128;
svmt.increase[ 6 ] = -128;
svmt.increase[ 7 ] = -128;
svmt.increase[ 8 ] = -128;
svmt.increase[ 9 ] = -128;
/*
* Update the Volume Modification Table without Wrap Mode.
*/
if (dx_setsvmt( dxxxdev, SV_VOLUMETBL, &svmt, 0 ) == -1){
printf( "Unable to Set the Volume" );
printf( " Modification Table\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_NONZEROSIZE |
|
EDX_SPDVOL |
|
EDX_SVMTRANGE |
|
EDX_SVMTSIZE |
|
EDX_SYSTEM |
|
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation