Create Account
Sign In

TTS in php

To create and answer topics, you must to be logged.
Pages: 1
Author Message
linanur
08/11/2011 at 05:43:03
linanur
Member
Hi, I've went to this site Open Sourced TTS and downloaded the contents.

However, I kept on getting errors with "Notice: Use of undefined constant txt - assumed 'txt' in C:\xampp\htdocs\TTS\r_ajax.php on line 10" I need to know whether anyone in this forum have tried this. I really need help in this TTS in PHP. Can anyone help me?

ybouane
12/11/2011 at 11:06:05
ybouane
Admin
Hi,
use this code in the page r_ajax.php:
<?php

header('Content-type: text/html; charset=ISO-8859-2');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . date('r'));
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');

$txt = urlencode(trim(strip_tags($_GET['txt'])));

?>

  <object id="Player" height="100" width="320" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=7,0,0,0">
   <param name="URL" value="example_2.php?txt=<?php echo $txt; ?>">
   <param name="FileName" value="example_2.php?txt=<?php echo $txt; ?>">
   <param name="TransparentAtStart" value="-1">
   <param name="AutoStart" value="true">
   <param name="AnimationatStart" value="1">
   <param name="ShowControls" value="1">
   <param name="enablecontextmenu" value="1">
   <param name="autoSize" value="true">
   <param name="displaySize" value="1">
   <param name="Volume" value="100">
   <param name="uiMode" value="mini">
   <param name="enablecontextmenu" value="0">
   <embed src="example_2.php?txt=<?php echo $txt; ?>" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" width="320" height="100" autostart="1" showcontrols="1" showstatusbar="1" showdisplay="1" autorewind="1" enablecontextmenu="1" loop="1" volume="100"></embed>
  </object>

Cordially :)

Image
linanur
12/11/2011 at 14:38:29
linanur
Member
Oh, thanks a lot ybouane :)

That solution solved the txt error, but somehow when I tried playing it, the voice didn't come up. Did it work when you tried it?

smithdavid
18/03/2012 at 08:02:17
smithdavid
Member
I Updated

Thanks to sharing....

Pages: 1