Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 339
record voice data from a single channel — dx_rec( )
!
!!
! Synchronous Operation
By default, this function runs synchronously, and returns a 0 to indicate that it has completed
successfully.
Set termination conditions using the DV_TPT structure, which is pointed to by the tptp parameter.
After dx_rec( ) terminates, use the ATDX_TERMMSK( ) function to determine the reason for
termination.
!
!!
! Cautions
On DM3 boards using a flexible routing configuration, voice channels must be listening to a
TDM bus time slot in order for any voice streaming functions, such as dx_rec( ), to work. In
other words, you must issue a dx_listen( ) function call on the device handle before calling any
voice streaming function for that device handle. Furthermore, the dx_listen( ) function must
be called within the same process as the voice streaming functions. The actual recording
operation will start only after the voice channel is listening to the proper external time slot.
The io_fhandle member of the DX_IOTT is normally set to the value of the descriptor
obtained when opening the file used for recording. That file cannot be opened in append mode
since multiple recordings would corrupt the file during playback because of different coders
used, header and other format-related issues. Consequently, when opening a file, the
O_APPEND flag is not supported and will cause TDX_ERROR to be returned if used.
!
!!
! Errors
If the function returns -1, use the Standard Runtime Library (SRL) Standard Attribute function
ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive
error message. One of the following error codes may be returned:
EDX_BADDEV
Invalid Device Descriptor
EDX_BADIOTT
Invalid DX_IOTT entry
EDX_BADPARM
Invalid parameter
EDX_BADTPT
Invalid DX_TPT entry
EDX_BUSY
Busy executing I/O function
EDX_SYSTEM
Error from operating system; use dx_fileerrno( ) to obtain error value
!
!!
! Example 1
This example illustrates how to using dx_rec( ) in synchronous mode.