Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 119
return the byte count for the last I/O transfer — ATDX_TRCOUNT( )
/* Record a voice file. Terminate on receiving a digit, max time,
* or reaching a byte count of 50000 bytes.
*/
.
.
/* set up DX_IOTT */
iott.io_type = IO_DEV|IO_EOT;
iott.io_bufp = 0;
iott.io_offset = 0L;
iott.io_length = 50000L;
if((iott.io_fhandle = dx_fileopen("file.vox", O_RDWR)) == -1) {
/* process error */
}
/* set up DV_TPTs for the required terminating conditions */
dx_clrtpt(tpt,2);
tpt[0].tp_type = IO_CONT;
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 */
tpt[1].tp_type = IO_EOT;
tpt[1].tp_termno = DX_MAXTIME; /* Maximum time */
tpt[1].tp_length = 100; /* terminate after 10 secs */
tpt[1].tp_flags = TF_MAXTIME; /* Use the default flags */
/* Now record to the file */
if (dx_rec(chdev,&iott,tpt,EV_SYNC) == -1) {
/* process error */
}
/* Examine transfer count */
if((trcount =
ATDX_TRCOUNT(chdev)
) == AT_FAILURE) {
/* Process error */
}
printf("%ld bytes recorded\n", trcount);
.
.
}
!
!!
! See Also
None.