PHP code example of luudoanh / text-to-speech

1. Go to this page and download the library: Download luudoanh/text-to-speech 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/ */

    

luudoanh / text-to-speech example snippets




App\TextToSpeechBasic;
$tts = new TextToSpeechBasic();
$config = array(
	'tl' => 'en', // Example: en => English, vi => Vietnamese
	'ie' => 'UTF-8', // The language character set you want to convert.
	'client' => 'tw-ob' // Constant
);
// Config settings
$tts->_setting($config);
// $file_path path to text file.
// $folder_save folder save audio file
echo $tts->TTS($file_path, $folder_save);
// return  Successful! is completed


App\TextToSpeechBasic;
$tts = new TextToSpeechBasic();
$config = array(
	'tl' => 'en', // Example: en => English, vi => Vietnamese
	'ie' => 'UTF-8', // The language character set you want to convert.
	'client' => 'tw-ob' // Constant
);
// Config settings
$tts->_setting($config);
// $file_path path to text file.
// $folder_save folder save audio file
echo $tts->TTS($file_path, $folder_save);
// return  Successful! is completed