Tts
Simple Google Tts Api Class
Features
- Set Api Key, Text, Lang Code, Voice Name, Encoding, Pitch, Rate, Save Path
- Fast, Simple and Light
Install
run the following command directly.
$ composer require omerfdmrl/tts
Simple Usage
include 'vendor/autoload.php';
use Omerfdmrl\Tts\Tts;
$tts = new Tts;
// Set Google Api Code
$tts->setApi('Api_Code');
// Set Text
$tts->setText('Hello World!');
// Send request to Google and save voice
$tts->get();
Advanced Usage
include 'vendor/autoload.php';
use Omerfdmrl\Tts\Tts;
$tts = new Tts;
// Set Google Api Code
$tts->setApi('Api_Code');
// Set Text
$tts->setText('Hello World!');
// Set Save Path
// Default is ./tts.mp3
$tts->setSavePath('tts.mp3');
// Set Language Code
// Default is en-US
$tts->setLanguageCode('en-US');
// Set Voice Name
// Default is en-US-Wavenet-F
$tts->setVoiceName('en-US-Wavenet-F');
// Set Encoding Type
// Default is MP3
$tts->setEncoding('MP3');
// Set Pitch
// Default is 0.00
$tts->setPitch(0.00);
// Set Speaking Rate
// Default is 1.00
$tts->setSpeakingRate(1.00);
// Send request to Google and save voice
$tts->get();
// Get error if exist
echo $tts->error();
Docs
Documentation page: Security Docs
Licence
Contributing
- Fork it ( https://github.com/omerfdmrl/tts/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- omerfdmrl Ömer Faruk Demirel - creator, maintainer