PHP code example of artemsk / gtts

1. Go to this page and download the library: Download artemsk/gtts library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

artemsk / gtts example snippets


$talking->download(); // get download response
$talking->getMp3();   // get mp3 filename, also TalkingHead::mp3('Hello World', 'en');
$talking->flush();    // clear 'storage' folder, also TalkingHead::clean();

$talking->raw($raw); // additional url parameter
$talking->writeToMp3(); // just create mp3
$talking->getProcessedText();
$talking->getTk($text); // get 'tk' parameter for text
$talking->getTkk(); // get token
$talking->getUrls();  // list of urls for tts
$talking->getSpentTime(); // Symfony StopwatchEvent to measure spent time for downloading