library google-speech-tts
A wrapper for Google Translate to generate an audio from a text.
google-free/google-speech-tts
A wrapper for Google Translate to generate an audio from a text.
- Sunday, July 23, 2017
- by Gyvastis
- Repository
- 1 Watchers
- 2 Stars
- 25 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 1 Versions
- 25 % Grown
Google Text-to-Speech Wrapper
Run it in your code
composer require google-free/google-speech-tts, (*1)
$audioOutputDir = __DIR__ . '/audio';
$ttsClient = new \GoogleFree\TextToSpeech\Client($httpClient);
$ttsClient->setAudioOutputDir($audioOutputDir);
$speechFile = new \GoogleFree\TextToSpeech\SpeechFile('The freedom of speech', 'en-US');
$didSucceed = $ttsClient->downloadAudio($speechFile);
// now you should see an audio file in the '/audio' directory
Test it out with an example
-
git clone git@github.com:Gyvastis/google-speech-tts.git, (*2)
-
composer install, (*3)
-
php example.php, (*4)
All available langauge tags can be found here., (*5)
Credits
This is an updated approach of AlboVieira., (*6)
As this is a very simple but still a wrapper over an existing service, use it at your own risk., (*7)
dev-master
9999999-dev
A wrapper for Google Translate to generate an audio from a text.
Sources
Download
The Requires