https://github.com/dayrev/synthesizer
Text-to-Speech Synthesizer
https://github.com/dayrev/synthesizer
google ispeech php polly synthesizer text-to-speech tts watson
Last synced: 5 months ago
JSON representation
Text-to-Speech Synthesizer
- Host: GitHub
- URL: https://github.com/dayrev/synthesizer
- Owner: dayrev
- License: apache-2.0
- Created: 2017-04-07T09:34:32.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-30T05:23:48.000Z (almost 9 years ago)
- Last Synced: 2024-12-18T11:09:53.895Z (over 1 year ago)
- Topics: google, ispeech, php, polly, synthesizer, text-to-speech, tts, watson
- Language: PHP
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Synthesizer
[](https://travis-ci.org/dayrev/synthesizer)
[](https://coveralls.io/github/dayrev/synthesizer?branch=master)
[](https://packagist.org/packages/dayrev/synthesizer)
## Overview
Synthesizer provides an elegant interface to synthesize text to speech (audio url) using a variety of third-party providers.
**Supported Providers:**
* Amazon Polly
* Google
* IBM Watson
* iSpeech
## Installation
Run the following [composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) command to add the package to your project:
```
composer require dayrev/synthesizer
```
Alternatively, add `"dayrev/synthesizer": "^1.0"` to your composer.json file.
## Usage
```php
$provider = Provider::instance('amazon', [
'key' => 'YOUR_AMAZON_API_KEY',
'secret' => 'YOUR_AMAZON_API_SECRET',
]);
$content = $synthesizer->synthesize($text);
$synthesizer = DayRev\Synthesizer\Provider::instance('google');
$content = $synthesizer->synthesize($text);
$synthesizer = DayRev\Synthesizer\Provider::instance('ibm', [
'username' => 'YOUR_IBM_USERNAME',
'password' => 'YOUR_IBM_PASSWORD',
]);
$content = $synthesizer->synthesize($text);
$synthesizer = DayRev\Synthesizer\Provider::instance('ispeech', [
'apikey' => 'YOUR_ISPEECH_API_KEY'
]);
$content = $synthesizer->synthesize($text);
```
## Tests
To run the test suite, run the following commands from the root directory:
```
composer install
vendor/bin/phpunit -d ibm_username=YOUR_IBM_USERNAME -d ibm_password=YOUR_IBM_PASSWORD -d ispeech_api_key=YOUR_ISPEECH_API_KEY -d amazon_api_key=YOUR_AMAZON_API_KEY -d amazon_api_secret=YOUR_AMAZON_API_SECRET
```
> **Note:** API credentials are required when running the integration tests but the values don't have to be valid.