Text To speech Convertor in php

Today i work on this project.The main work of this project to convert the text into speech.so today i gave the tutorial on this projetc

Requirements

First install the fastival program this program gave the help to convert the text file into speech.

sudo apt-get install fastival

Program

 

<?php
$filename=”text.txt”;
$text=”oye ki haal bhai tera”;
$outputfile=basename($filename,”.txt”);
$outputfile=$outputfile.”.wav”;
if(!$handle=fopen($filename,’w’))
{
return false;
}
if(fwrite($handle,$text) ===FALSE)
{
return false;
}
fclose($filename);
$cmd=”text2wave $filename -o $outputfile”;
exec($cmd);
echo “output file is”.$outputfile;
return $outputfile;
?>

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s