https://github.com/421p/talker
text to speech using google tts
https://github.com/421p/talker
google-text-to-speech tts tts-api tts-engine
Last synced: 11 months ago
JSON representation
text to speech using google tts
- Host: GitHub
- URL: https://github.com/421p/talker
- Owner: 421p
- Created: 2018-09-22T23:38:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-23T00:17:46.000Z (over 7 years ago)
- Last Synced: 2025-05-25T21:07:46.743Z (about 1 year ago)
- Topics: google-text-to-speech, tts, tts-api, tts-engine
- Language: PHP
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Talker
Text to speech using Google TTS
## Installing
```
composer require 421p/talker
```
## Usage
```php
use React\EventLoop\Factory;
use Talker\Talker\GoogleSpeechTalker;
use Talker\Talker\Response\Mp3File;
require __DIR__.'/vendor/autoload.php';
$loop = Factory::create();
$talker = new GoogleSpeechTalker($loop);
[$hours, $minutes] = explode(':', date('H:i'));
$time = sprintf(
'Current time is %d hours %d minutes', $hours, $minutes
);
$talker->say($time, GoogleSpeechTalker::LOCALE_EN_US)->then(function (Mp3File $file) {
file_put_contents(__DIR__.'/test.mp3', $file->getContent());
});
$loop->run();
```