CTI_dx_play
dx_play( )
Chuc nang: Chy file am thanh da ghi truoc do tren mot kenh quy dinh
* Chay 1 file thoai. Ket thuc khi nhan duoc 4 chu so hoac ket thuc file
#include <fcntl.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main( )
{
int chdev;
DX_IOTT iott;
DV_TPT tpt;
DV_DIGIT dig;
/* Mo kenh su dung dx_open(), lay mieu ta kenh thiet bi trong chdev*/
if ((chdev = dx_open("dxxxB1C1",NULL)) == -1) {
/* process error */
}
/* set up DX_IOTT */
iott.io_type = IO_DEV|IO_EOT;
iott.io_bufp = 0; /*Con tro den bo nho co so*/
iott.io_offset = 0; /*Bo dem bu*/
iott.io_length = -1; /* Chay den khi ket thuc file */
if((iott.io_fhandle = dx_fileopen("prompt.vox", O_RDONLY|O_BINARY))
== -1) {
/* process error */
}
/* set up DV_TPT */
dx_clrtpt(&tpt,1);
tpt.tp_type = IO_EOT; /* Chi muc trong bang */
tpt.tp_termno = DX_MAXDTMF; /* So chu so toi da */
tpt.tp_length = 4; /* Ket thuc tai 4 chu so */
tpt.tp_flags = TF_MAXDTMF; /* Su dung co mac dinh */
/* Xoa cac chu so da nhap truoc do */
if (dx_clrdigbuf(chdev) == -1) {
/* process error */
}
/* Chay file */
if (dx_play(chdev,&iott,&tpt,EV_SYNC) == -1) {
/* process error */
}
/* Nhap so vao dx_getdig( ) va tiep tuc tien trinh */
}
Bạn đang đọc truyện trên: Truyen247.Pro