Dialogic boards can play VOX files as well as WAV files. While many people use dx_playwav() function of Dialogic API to play WAV files, dx_playiottdata() function can also be used to play WAV files as shown in the code snippet below.
While the most famous dialogic sample demo application does not play any audio file, found in C:Program FilesDialogicdemosgc_basic_call_model ( by default), gc_basic_call_model.c is the should be the first sample program for anyone willing to develop IVR Software of IVRS Applications using Dialogic Boards.
Using WAV file in IVRS Software has advantage. There are many WAV file editors, some free and some licensed available to make WAV files easily. Use of many TTS engines too becomes much easier if WAV file is used for playback of voice prompts. But VOX file does not have necessarily any disadvantage! It can be just a personal choice.
While searching internet, I tried to find some sample code snippet for playing WAV files using dx_playiottdata(), and I could not find one. So I thought I myself should put up a sample code snippet which might be useful to some beginners.
Here is the code snippet:
int play(char *filename)
int retStatus = -1; // Unknown Error
if ( ( handle= dx_fileopen( filepath, O_RDONLY|O_BINARY, 0666) ) == -1 )
// Errore handling here
/* rewind to top of file */
* Clear and Set-Up the IOTT strcuture
memset( iott, 0, sizeof( DX_IOTT ) );
iott[ 0 ].io_type = IO_DEV | IO_EOT;
iott[ 0 ].io_fhandle = handle;
iott[ 0 ].io_length = -1;
* Clear and then Set the DV_TPT structures
memset( tpt, 0, sizeof( DV_TPT ) );
/* Terminate Play on Receiving any DTMF tone */
tpt[ 0 ].tp_type = IO_CONT;
tpt[ 0 ].tp_termno = DX_MAXDTMF;
tpt[ 0 ].tp_length = 1;
tpt[ 0 ].tp_flags = TF_MAXDTMF;
// Error Handling
retStatus = 1;
// Playy successfully
retStatus = 0;