
Description | Example | Errors | See Also
Name: |
int dx_playf(chdev,fnamep,tptp,mode) | |
Inputs: |
int chdev |
|
char *fnamep |
| |
DV_TPT *tptp |
| |
unsigned short mode |
| |
Returns: |
0 if success | |
-1 if failure | ||
Includes: |
srllib.h | |
dxxxlib.h | ||
Category: |
Convenience | |
dx_playf( ) is a convenience function that synchronously plays voice data or transfers ADSI data (using the ADSI protocol) from a single file.
dx_playf( ) operates the same as synchronous dx_play( ) if the DX_IOTT structure specified a single file entry. dx_playf( ) is provided as a convenient way to play back data or transfer ADSI data from a single file without having to specify a DX_IOTT structure for only one file. The dx_playf( ) function opens and closes the file specified by fnamep while the dx_play( ) function uses a DX_IOTT structure that requires the application to open and close the file.
Parameter |
Description |
fnamep |
points to the file from which voice data will be played. |
For information about other function arguments and transferring ADSI data, see dx_play( ).
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int chdev;
DV_TPT tpt[2];
/* Open the channel using dx_open( ). Get channel device descriptor in
* chdev.
*/
if ((chdev = dx_open("dxxxB1C1",NULL)) == -1) {
/* process error */
}
/*
* Set up the DV_TPT structures for MAXDTMF. Play until one digit is
* pressed or the file has completed play
*/
dx_clrtpt(tpt,1);
tpt[0].tp_type = IO_EOT; /* only entry in the table */
tpt[0].tp_termno = DX_MAXDTMF; /* Maximum digits */
tpt[0].tp_length = 1; /* terminate on the first digit */
tpt[0].tp_flags = TF_MAXDTMF; /* Use the default flags */
if (dx_playf(chdev,"weather.vox",tpt,EV_SYNC) == -1) {
/* process error */
}
.
.
}
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_BADIOTT |
|
EDX_BADTPT |
|
EDX_BUSY |
|
EDX_SYSTEM |
|
Related Functions:
Setting Speed and Volume:
Setting and Handling Play Termination:
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation