<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IVR World &#187; DV_TPT</title>
	<atom:link href="http://www.ivrsworld.com/tag/dv_tpt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ivrsworld.com</link>
	<description>IVR, Interactive Voice Response System, CTI Applications</description>
	<lastBuildDate>Fri, 10 Feb 2012 09:25:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Playing WAV File in Dialogic Boards</title>
		<link>http://www.ivrsworld.com/dialogic-tip/playing-wav-file-in-dialogic-boards/</link>
		<comments>http://www.ivrsworld.com/dialogic-tip/playing-wav-file-in-dialogic-boards/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 08:33:25 +0000</pubDate>
		<dc:creator>Uttam Pegu</dc:creator>
				<category><![CDATA[Dialogic Tip]]></category>
		<category><![CDATA[audio file]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[dialogic api]]></category>
		<category><![CDATA[DTMF]]></category>
		<category><![CDATA[DV_TPT]]></category>
		<category><![CDATA[DX_IOTT]]></category>
		<category><![CDATA[dx_play]]></category>
		<category><![CDATA[dx_playiottdata]]></category>
		<category><![CDATA[VOX]]></category>
		<category><![CDATA[WAV file]]></category>

		<guid isPermaLink="false">http://www.ivrsworld.com/?p=278</guid>
		<description><![CDATA[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, [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Dialogic boards can play VOX files as well as WAV files. While many people use dx_playwav() function of <strong>Dialogic API</strong> to play WAV files, dx_playiottdata() function can also be used to play WAV files as shown in the code snippet below.</p>
<p>While the most famous dialogic sample demo application does not play any audio file, found in C:\Program Files\Dialogic\demos\gc_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.</p>
<p>Using WAV file in <strong>IVRS Software</strong> 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.<br />
<span id="more-278"></span><br />
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.</p>
<p><strong>Here is the code snippet: </strong></p>
<p>int play(char *filename)<br />
{<br />
	int retStatus = -1; // Unknown Error</p>
<p>	int handle;<br />
	char filepath[1000];</p>
<p>	strcat(filepath,filename);</p>
<p>	if ( ( handle= dx_fileopen( filepath, O_RDONLY|O_BINARY, 0666) ) == -1 )<br />
	   {<br />
	     // Errore handling here<br />
	   }</p>
<p>	/* rewind to top of file */<br />
	lseek(handle,0L,0);</p>
<p>	/*<br />
	    * Clear and Set-Up the IOTT strcuture<br />
	    */<br />
	memset( iott, 0, sizeof( DX_IOTT ) );</p>
<p>	iott[ 0 ].io_type    = IO_DEV | IO_EOT;<br />
	iott[ 0 ].io_fhandle = handle;<br />
	iott[ 0 ].io_length  = -1;</p>
<p>	/*<br />
	    * Clear and then Set the DV_TPT structures<br />
	    */<br />
	memset( tpt, 0, sizeof( DV_TPT ) );</p>
<p>	/* Terminate Play on Receiving any DTMF tone */<br />
	tpt[ 0 ].tp_type   = IO_CONT;<br />
	tpt[ 0 ].tp_termno = DX_MAXDTMF;<br />
	tpt[ 0 ].tp_length = 1;<br />
	tpt[ 0 ].tp_flags  = TF_MAXDTMF;</p>
<p>	if(dx_playiottdata(voiceh,iott,tpt,&#038;xpbWavTbl[0],EV_ASYNC)==-1)<br />
	{<br />
		// Error Handling<br />
                retStatus = 1;<br />
	}<br />
	else<br />
	{<br />
		// Playy successfully<br />
                retStatus = 0;<br />
	}</p>
<p>	return retStatus;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivrsworld.com/dialogic-tip/playing-wav-file-in-dialogic-boards/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

