The DX_IOTT data structure contains parameters for the Input/Output Transfer Table.
The DX_IOTT structure identifies a source or destination for voice data. It is used with the dx_play( ) and dx_rec( ) functions.
A DX_IOTT structure describes a single data transfer to or from one file, memory block, or custom device. If the voice data is stored on a custom device, the device must have a standard Windows device interface. The device must support open( ), close( ), read( ), and write( ) and lseek( ).
To use multiple combinations, each source or destination of I/O is specified as one element in an array of DX_IOTT structures. The last DX_IOTT entry must have IO_EOT specified in the io_type field.
5.10.2. DX_IOTT DefinitionThe typedef for the structure is as follows:
typedef struct dx_iott {
unsigned short io_type; /* Transfer type */
unsigned short rfu; /* Reserved */
int io_fhandle; /* File descriptor */
char * io_bufp; /* Pointer to base memory */
unsigned long io_offset; /* File/Buffer offset */
long int io_length; /* Length of data */
DX_IOTT *io_nextp; /* Ptr to next DX_IOTT if IO_LINK set */
DX_IOTT *io_prevp; /* (Optional) Ptr to previous DX_IOTT */
}DX_IOTT;
5.10.3. DX_IOTT Parameters
Parameter |
Description | |
Specifies whether the data is stored in a file or in memory. It also determines if the next DX_IOTT structure is contiguous in memory, linked, or if this is the last DX_IOTT in the chain. It is also used to enable WAVE data offset I/O. Set the io_type field to an OR combination of the following defines. | ||
Description | ||
| ||
| ||
| ||
Description | ||
| ||
| ||
| ||
If none of IO_CONT, IO_LINK, or IO_EOT are specified, IO_CONT is assumed. | ||
Description | ||
| ||
To enable offset I/O for WAVE data, set the DX_IOTT io_type field to IO_USEOFFSET ORed with the IO_DEV define (to indicate file data rather than memory buffer).
| ||
Specifies a unique file descriptor provided by the dx_fileopen( ) function if IO_DEV is set in io_type. If IO_DEV is not set in io_type, io_fhandle should be set to 0. | ||
Specifies a base memory address if IO_MEM is set in io_type. | ||
Specifies one of the following: | ||
| ||
| ||
| ||
Specifies the number of bytes allocated for recording or the byte length of the playback file. Specify -1 to play until end of data. During dx_play( ), a value of -1 causes playback to continue until an EOF is received or one of the terminating conditions is satisfied. During dx_rec( ), a value of -1 in io_length causes recording to continue until one of the terminating conditions is satisfied. | ||
Points to the next DX_IOTT structure in the linked list if IO_LINK is set in io_type. | ||
Points to the previous DX_IOTT structure. This field is automatically filled in when dx_rec( ) or dx_play( ) are called. The io_prevp field of the first DX_IOTT structure is set to NULL. | ||
5.10.4. DX_IOTT Playback Array ExampleThe following example uses different sources for playback, an array or linked list of DX_IOTT structures.
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
DX_IOTT iott[3];
/* first iott: voice data in a file with descriptor fd1*/
iott[0].io_fhandle = fd1;
iott[0].io_offset = 0;
iott[0].io_length = -1;
iott[0].io_type = IO_DEV;
/* second iott: voice data in a file with descriptor fd2 */
iott[1].io_fhandle = fd2;
iott[1].io_offset = 0;
iott[1].io_length = -1;
iott[1].io_type = IO_DEV;
/* third iott: voice data in a file with descriptor fd3 */
iott[2].io_fhandle = fd3;
iott[2].io_offset = 0;
iott[2].io_length = -1;
iott[2].io_type = IO_DEV|IO_EOT;
.
.
/* play all three voice files: pass &iott[0] as argument to dx_play( )
.
.
/* form a linked list of iott[0] and iott[2] */
iott[0].io_nextp=&iott[2];
iott[0].io_type|=IO_LINK
/* pass &iott[0] as argument to dx_play( ). This time only files 1 and 3
* will be played.
*/
.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation