Intel 05-1832-002 IP Phone User Manual


 
290 Voice API for Windows Operating Systems Library Reference — November 2003
dx_mreciottdata( ) — record voice data from two TDM bus time slots
/* Set up SC_TSINFO structure */
tsinfo.sc_numts = 2;
tsinfo.sc_tsarrayp = &tslots[0];
/* Set up DX_XPB structure */
xpb.wFileFormat = FILE_FORMAT_VOX;
xpb.wDataFormat = 0;
xpb.nSamplesPerSec = 0L;
xpb.wBitsPerSample = 0;
/*Set up DV_TPT structure */
dx_clrtpt (&tpt,1);
tpt.tp_type = IO_EOT;
tpt.tp_termno = DX_MAXDTMF;
tpt.tp_length = 1;
tpt.tp_flags = TF_MAXDTMF;
/* Set up DX_IOTT structure */
iott[0].io_fhandle = fd;
iott[0].io_type = IO_DEV;
iott[0].io_offset = 0;
iott[0].io_length = MAXLEN;
iott[0].io_offset = IO_EOT;
/* And record from both voice channels */
if (
dx_mreciottdata(devh3, &iott[0], &tpt, &xpb, RM_TONE, &tsinfo)
== -1) {
printf("Error recording from dxxxB1C1 and dxxxB1C2\n");
printf("error = %s\n", ATDV_ERRMSGP(devh1));
exit(2);
}
/* Display termination condition value */
printf ("The termination value = %d\n", ATDX_TERMMSK(devh1));
/* And close three voice channels */
if (dx_close(devh3) == -1){
printf("Error closing devh3 \n");
/* Perform system error processing */
exit(3);
}
if (dx_close(devh2) == -1) {
printf("Error closing devh2\n");
/* Perform system error processing */
exit (3);
}
if (dx_close(devh1) == -1) {
printf("Error closing devh1\n");
/* Perform system error processing */
exit (3);
}
if (dx_fileclose(fd) == -1){
printf("File close error \n");
exit(1);
}
/* And finish */
return;
}
!
!!
! See Also
dx_rec( )
dx_play( )