Previous PageTable Of Contents../index.htmlIndexNext Page



5.10. DX_IOTT: Input/Output Transfer Table

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.

NOTE:
The DX_IOTT data area must remain in scope for the duration of the function if running asynchronously.

The typedef for the structure is as follows:

Parameter

Description

io_type

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.

   
 

Data Transfer Type

Description

 

IO_DEV

  file data

 

IO_MEM

  memory data

 

IO_UIO

  nonstandard storage media data using the dx_setuio( ) function; must be ORed with IO_DEV

   
 

Structure Linkage

Description

 

IO_CONT

  the next DX_IOTT structure is contiguous (default)

 

IO_LINK

  the next DX_IOTT structure is part of a linked list

 

IO_EOT

  this is the last DX_IOTT structure in the chain

 

If none of IO_CONT, IO_LINK, or IO_EOT are specified, IO_CONT is assumed.

   
 

Other Types

Description

 

IO_USEOFFSET

  enables use of the io_offset and io_length fields for WAVE data

 

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).

NOTE:
Wave files cannot be recorded to memory buffers or played from memory buffers.
   

io_fhandle

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.

io_bufp

Specifies a base memory address if IO_MEM is set in io_type.

io_offset

Specifies one of the following:

 

  an offset from the beginning of a file if IO_DEV is specified in io_type.

 

  for WAVE file offset I/O (IO_DEV is ORed with IO_USEOFFSET in io_type), set the io_offset field to a file offset value that is calculated from the beginning of the WAVE audio data rather than the beginning of the file (that is, the first 80 bytes that make up the file header are not counted).

 

  an offset from the base buffer address specified in io_bufp if IO_MEM is specified in io_type.

io_length

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.

io_nextp

Points to the next DX_IOTT structure in the linked list if IO_LINK is set in io_type.

io_prevp

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.

The following example uses different sources for playback, an array or linked list of DX_IOTT structures.


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2002, Dialogic Corporation
All rights reserved
This page generated February, 2002