Skip to content
text to speech using google tts
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Talker
.gitignore
README.md
composer.json
composer.lock

README.md

Talker

Text to speech using Google TTS

Installing

composer require 421p/talker

Usage

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();
You can’t perform that action at this time.