PHP Classes

PHP TTS Solution with PHP Text to Speech Class: Generate speech audio to say a given text

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-06-15 (6 months ago) RSS 2.0 feedStarStarStar 50%Total: 3,208 All time: 1,103 This week: 53Up
Version License PHP version Categories
php-text-to-speech 1.11GNU General Publi...4.3Text processing, Audio
Description 

Author

This class can generate speech audio to say a given text.

It can send a HTTP request to the Google Translate API to say a given text.

The class downloads the speech audio in MP3 format and stores it in a given file.

Picture of Radovan Janjic
  Performance   Level  
Name: Radovan Janjic is available for providing paid consulting. Contact Radovan Janjic .
Classes: 14 packages by
Country: Serbia Serbia
Age: 36
All time rank: 2382 in Serbia Serbia
Week rank: 128 Up1 in Serbia Serbia Up
Innovation award
Innovation award
Nominee: 3x

Recommendations

Example

<?php

/**
* PHP_Text2Speech Class example
*/

include 'PHP_Text2Speech.class.php';

$t2s = new PHP_Text2Speech;

?>
<audio controls="controls" autoplay="autoplay">
  <source src="<?php echo $t2s->speak('Facebook is a very large social network where you can find a lot of people. You can also find there a community of PHP Classes site users.
If you are a member of Facebook you can join the PHP Classes site users community and follow the site activity updates that are posted on the site page wall.
Please click on the Like button in the PHP Classes site community page at Facebook so we can grow the community of site users at Facebook.'
); ?>" type="audio/mp3" />
</audio>


Details

PHP_Text2Speech

This class can generate speech audio to say a given text.

It can send a HTTP request to the Google Translate API to say a given text.

The class downloads the speech audio in MP3 format and stores it in a given file.


  Files folder image Files (4)  
File Role Description
Files folder imageaudio (1 file)
Accessible without login Plain text file example.php Example Example script
Plain text file PHP_Text2Speech.class.php Class Class file
Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files (4)  /  audio  
File Role Description
  Accessible without login Plain text file 4aa9c9af3a5a303c72be02150b5dc5dc.mp3 Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:3,208
This week:0
All time:1,103
This week:53Up
User Ratings User Comments (2)
 All time
Utility:70%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:79%StarStarStarStar
Tests:-
Videos:-
Overall:50%StarStarStar
Rank:2645