Intel 05-1832-002 IP Phone User Manual


 
170 Voice API for Windows Operating Systems Library Reference — November 2003
dx_CloseStreamBuffer( ) — delete a circular stream buffer
!
!!
! Example
#include <srllib.h>
#include <dxxxlib.h>
main()
{
int nBuffSize = 32768, vDev = 0;
int hBuffer = -1;
char pData[1024];
DX_IOTT iott;
if ((hBuffer = dx_OpenStreamBuffer(nBuffSize)) < 0)
{
printf("Error opening stream buffer \n");
exit(1);
}
if (dx_PutStreamData(hBuffer, pData, 1024, STREAM_CONT) < 0)
{
printf("Error in dx_PutStreamData \n");
exit(2);
}
if ((vDev = dx_open("dxxxB1C1", 0)) < 0)
{
printf("Error opening voice device\n");
exit(3);
}
iott.io_type = IO_STREAM|IO_EOT;
iott.io_bufp = 0;
iott.io_offset = 0;
iott.io_length = -1; /* play until STREAM_EOD */
iott.io_fhandle = hBuffer;
if (dx_playiottdata(vDev, &iott, NULL, EV_SYNC) < 0)
{
printf("Error in dx_play() %d\n", ATDV_LASTERR(vDev));
}
if (dx_close(vDev) < 0)
{
printf("Error closing voice device\n");
}
if (
dx_CloseStreamBuffer(hBuffer)
< 0)
{
printf("Error closing stream buffer \n");
}
}
!
!!
! See Also
dx_OpenStreamBuffer( )
dx_GetStreamInfo( )