lunes, 6 de abril de 2015

How to convert text to MP3 speech/Voice using Google API

<?php
include 'PHP_Text2Speech.class.php';
    $t2s = new PHP_Text2Speech;
?>
    <audio controls="controls" autoplay="autoplay">
       <source src="<?php echo $t2s->speak("Hello PHPGang");?>" type="audio/mp3" />    
    </audio>
Calling Google url to get mp3 file.\\


<?php
include 'PHP_Text2Speech.class.php';
    $t2s = new PHP_Text2Speech;
?>
    <audio controls="controls" autoplay="autoplay">
       <source src="<?php echo $t2s->speak("Hello PHPGang");?>" type="audio/mp3" />    
    </audio>
Calling Google url to get mp3 file.
1
2
3
if (!file_exists($this->mp3File)) {
            $this->download("http://translate.google.com/translate_tts?ie=UTF-8&q={$this->text}&tl={$this->lang}&total={$this->wordCount}&idx=0&textlen={$this->textLen}", $this->mp3File);
        }

?>
















http://www.phpgang.com/how-to-convert-text-to-mp3-voice_284.html

No hay comentarios:

Publicar un comentario