newage / audio-manager
Audio Manager for text-to-speech cloud services
Installs: 3 967
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 5
Forks: 1
Open Issues: 1
Requires
- php: >=5.6 | >= 7.0
- aws/aws-sdk-php: ^3.21
Requires (Dev)
- phpmd/phpmd: 2.4.*
- phpunit/phpunit: 4.8.*
- squizlabs/php_codesniffer: 2.5.*
README
A manager for a popular text-to-speech cloud services (Google, Ivona, Amazon Polly...) on PHP. This project uses PSR-4 autoloading standard, PSR-2 coding style
Install
Via Composer
$ composer require newage/audio-manager
Usage
Setup an Google
adapter
$adapter = new \AudioManager\Adapter\Google();
$adapter->getOptions()->setLanguage('en');
$adapter->getOptions()->setEncoding('UTF-8');
Setup an Ivona
adapter
$adapter = new \AudioManager\Adapter\Ivona();
$adapter->getOptions()->setAccessKey('...');
$adapter->getOptions()->setSecretKey('...');
$adapter->getOptions()->setLanguage('...'); //Default 'en-US'
$adapter->getOptions()->setVoice('...'); //Default 'Salli'
$adapter->getOptions()->setOutputFormatCodec('...'); //Default 'MP3'
$adapter->getOptions()->setOutputSampleRate('...'); //Default '22050'
$adapter->getOptions()->setParametersRate('...'); //Default 'slow'
Setup an Amazon Polly
adapter
$adapter = new \AudioManager\Adapter\Polly();
$adapter->getOptions()->initialize()
->setVersion('latest')
->setRegion('us-west-2')
->setCredentials()
->setKey('...')
->setSecret('...');
$adapter->getOptions()->setOutputFormat('...'); //Default 'mp3'
$adapter->getOptions()->setLexiconNames('...');
$adapter->getOptions()->setSampleRate('...'); //Default '16000'
$adapter->getOptions()->setTextType('...'); //Default 'text'
$adapter->getOptions()->setVoiceId('...'); //Default 'Salli'
Setup an adapter to manager
$manager = new \AudioManager\Manager($adapter);
$audioContent = $manager->read('text');
$manager->getHeaders();
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email vadim.leontiev@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.