PHP code example of 421p / talker

1. Go to this page and download the library: Download 421p/talker 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/ */

    

421p / talker example snippets


use React\EventLoop\Factory;
use Talker\Talker\GoogleSpeechTalker;
use Talker\Talker\Response\Mp3File;

, 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();