Intel 05-1832-002 IP Phone User Manual


 
314 Voice API for Windows Operating Systems Library Reference — November 2003
dx_playiottdata( ) — play back recorded voice data from multiple sources
/* Open VOX file to cache */
if ((fd = dx_fileopen("HELLO.VOX",O_RDONLY|O_BINARY)) == -1) {
printf("File open error\n");
exit(2);
}
/* This specifies the data to cache */
iottp.io_fhandle = fd;
iottp.io_bufp = 0;
iottp.io_offset = 0;
iottp.io_length = -1;
iottp.io_type = IO_DEV | IO_EOT;
/* Download a prompt to the on-board memory */
if (dx_cacheprompt(brdhdl, &iottp, &promptHandle, EV_SYNC) == -1 {
printf("dx_cacheprompt error \n");
exit(3);
}
/* Set to terminate play on 1 digit */
tpt.tp_type = IO_EOT;
tpt.tp_termno = DX_MAXDTMF;
tpt.tp_length = 1;
tpt.tp_flags = TF_MAXDTMF;
/*This block specifies the downloaded cache prompt */
iott.io_type = IO_CACHED | IO_EOT
iott.io_fhandle = promptHandle;
iott.io_offset = 0;
iott.io_length = -1;
/* Specify VOX file format for ADPCM at 8KHz */
xpb.wFileFormat = FILE_FORMAT_VOX;
xpb.wDataFormat = DATA_FORMAT_DIALOGIC_ADPCM;
xpb.nSamplesPerSec = DRT_8KHZ;
xpb.wBitsPerSample = 4;
/* Clear digit buffer */
dx_clrdigbuf(chdev);
/* Start playback */
if (
dx_playiottdata(chdev,&iott,&tpt,&xpb,EV_SYNC
)==-1) {
printf("Error playing file - %s\n", ATDV_ERRMSGP(chdev));
exit(4);
}
dx_fileclose(fd);
dx_close(brdhdl);
dx_close(chdev);
}
!
!!
! See Also
dx_play( )
dx_playf( )
dx_playwav( )
dx_playvox( )
dx_setuio( )