
Description | Cautions | Example | Errors | See Also
Name: |
int dx_setsvcond( chdev, numblk, svcbp) | |
Inputs: |
int chdev |
|
unsigned short numblk |
| |
DX_SVCB * svcbp |
| |
Returns: |
0 if success | |
-1 if failure | ||
Includes: |
srllib.h | |
dxxxlib.h | ||
Category: |
Speed and Volume | |
The dx_setsvcond( ) function sets adjustments and adjustment conditions for all subsequent plays on the specified channel (until changed or cancelled). An "adjustment" is a modification to play-speed or play-volume that takes place due to an "adjustment condition" such as start of play, or the occurrence of an incoming digit during play. This function uses the specified channel's speed or volume Speed/Volume Modification Table. Detailed information about these tables are contained in the Voice Software Reference: Voice Features Guide.
The following adjustments and adjustment conditions are defined in the Speed/Volume Adjustment Condition Blocks DX_SVCB):
See the chapter on Data Structures for a full description of the DX_SVCB structure. Up to 20 DX_SVCB blocks can be specified in the form of an array.
Parameter |
Description |
chdev |
specifies the valid channel device handle obtained by a call to dx_open( ). |
numblk |
specifies the number of DX_SVCB blocks in the array. Set to a value between 1 and 20. |
svcbp |
points to an array of DX_SVCB structures. |
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
/*
* Global Variables
*/
DX_SVCB svcb[ 10 ] = {
/* BitMask AjustmentSize AsciiDigit DigitType */
{ SV_SPEEDTBL | SV_RELCURPOS, 1, '1', 0 }, /* 1 */
{ SV_SPEEDTBL | SV_ABSPOS, -4, '2', 0 }, /* 2 */
{ SV_VOLUMETBL | SV_ABSPOS, 1, '3', 0 }, /* 3 */
{ SV_SPEEDTBL | SV_ABSPOS, 1, '4', 0 }, /* 4 */
{ SV_SPEEDTBL | SV_ABSPOS, 1, '5', 0 }, /* 5 */
{ SV_VOLUMETBL | SV_ABSPOS, 1, '6', 0 }, /* 6 */
{ SV_SPEEDTBL | SV_RELCURPOS, -1, '7', 0 }, /* 7 */
{ SV_SPEEDTBL | SV_ABSPOS, 6, '8', 0 }, /* 8 */
{ SV_VOLUMETBL | SV_RELCURPOS, -1, '9', 0 }, /* 9 */
{ SV_SPEEDTBL | SV_ABSPOS, 10, '0', 0 }, /* 10 */ };
main()
{
int dxxxdev;
/*
* Open the Voice Channel Device and Enable a Handler
*/
if ( ( dxxxdev = dx_open( "dxxxB1C1", NULL) ) == -1 ) {
perror( "dxxxB1C1" );
exit( 1 );
}
/*
* Set Speed and Volume Adjustment Conditions
*/
if ( dx_setsvcond( dxxxdev, 10, svcb ) == -1 ) {
printf( "Unable to Set Speed and Volume" );
printf( " Adjustment Conditions\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 |
|
Setting Speed and Volume conditions:
Related to Speed and Volume:
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation