
Description | Cautions | Example | Errors | See Also
Name: |
int dx_adjsv(chdev,tabletype,action,adjsize) | |
Inputs: |
int chdev |
|
unsigned short tabletype |
| |
unsigned short action |
| |
unsigned short adjsize |
| |
Returns: |
0 if successful | |
-1 if failure | ||
Includes: |
srllib.h | |
Category: |
Speed and Volume | |
The dx_adjsv( ) function adjusts speed or volume immediately, and for all subsequent plays on a specified channel (until changed or cancelled). Speed or volume can be set to a specific value, adjusted incrementally, or can be set to toggle. See the action parameter description for information.
dx_adjsv( ) utilizes the Speed and Volume Modification Tables to make adjustments to play-speed or play-volume. These tables have 21 entries that represent different levels of speed or volume. There are up to ten levels above and below the regular speed or volume. These tables can be set with explicit values using dx_setsvmt( ) or default values can be used. Refer to the Voice Software Reference: Voice Features Guide for detailed information about these tables.
Parameter |
Description | |
chdev |
specifies the valid channel device handle obtained when the channel was opened using dx_open( ). | |
tabletype |
specifies whether to modify the play-back using a value from the Speed or the Volume Modification Table. | |
|
Use the Speed Modification Table | ||
Use the Volume Modification Table | ||
action |
specifies the type of adjustment to make. Set to one of the following: | |
|
Set speed or volume to a specified position in the appropriate table. (The position is set using the adjsize parameter). | ||
|
Adjust speed or volume by the number of steps specified using the adjsize parameter. | ||
|
Toggle between values specified using the adjsize parameter. | ||
|
adjsize |
specifies the size of the adjustment. adjsize has a different value depending on how the adjustment type is set using the action parameter. Set adjsize to one of the following: | |
None.
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int dxxxdev;
/*
* Open the Voice Channel Device and Enable a Handler
*/
if ( ( dxxxdev = dx_open( "dxxxB1C1", NULL) ) == -1 ) {
perror( "dxxxB1C1" );
exit( 1 );
}
/*
* Modify the Volume of the playback so that it is 4dB
* higher than normal.
*/
if ( dx_adjsv( dxxxdev, SV_VOLUMETBL, SV_ABSPOS, SV_ADD4DB ) == -1 ) {
printf( "Unable to Increase Volume by 4dB\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 |
|
Related to Speed and Volume:
Setting Speed and Volume conditions:
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation