PHP Classes

File: tts/index.php

Recommend this page to a friend!
  Classes of Mahmut Namli  >  PHP Google Text to Speech  >  tts/index.php  >  Download  
File: tts/index.php
Role: Example script
Content type: text/plain
Description: Google TTS example file
Class: PHP Google Text to Speech
Convert words to voice using Google Translate API
Author: By
Last change: 1) Added multiple instance examples of script for beginner level users
2) File save logic changed for compatibility of multiple voice instances
Date: 8 years ago
Size: 881 bytes
 

Contents

Class file image Download
<?php
    $timestamp
= time();
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Google_TTS Class Multiple Instance Example</title>
        <meta charset="UTF-8" />
    </head>
    <body>
        <h2>Voice of the word: Hi guys.</h2>
        <audio controls>
            <source src="sound.php?lang=en&word=Hi guys.&unique=<?=$timestamp;?>" type="audio/mpeg">
            Your browser does not support the audio element.
        </audio>
        <br />

        <h2>Voice of the word: example</h2>
        <audio controls>
            <source src="sound.php?lang=en&word=example&unique=<?=$timestamp;?>" type="audio/mpeg">
            Your browser does not support the audio element.
        </audio>
        <br />

        <h2>Voice of the word: Even more text</h2>
        <audio controls>
            <source src="sound.php?lang=en&word=Even more text&unique=<?=$timestamp;?>" type="audio/mpeg">
            Your browser does not support the audio element.
        </audio>
    </body>
</html>

For more information send a message to info at phpclasses dot org.