Download the PHP package ekandreas/sayit without Composer
On this page you can find all versions of the php package ekandreas/sayit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ekandreas/sayit
More information about ekandreas/sayit
Files in ekandreas/sayit
Package sayit
Short Description Converts text to speech via AWS and place it in a S3 bucket folder
License MIT
Homepage https://github.com/ekandreas/sayit
Informations about the package sayit
Sayit
Converts text to speech via AWS and place it in a S3 bucket folder This package is PHP agnostic. Follow these steps to get started:
composer require ekandreas/sayit- Register an IAM programmatic account and set policy S3 full access and Polly Full Access to it.
- Use the key, secret, region and bucket name with the factory helper.
-
Open a public folder in your S3 bucket and create a folder in it.
Code example:
ElevenLabs
Speech can also be generated with ElevenLabs. The mp3 is still stored in your S3 bucket. Pass your ElevenLabs API key and a voice ID to switch provider:
Switch between providers with ->provider('polly') or ->provider('elevenlabs').
The voice ID and model can also be changed with ->elevenlabsVoice($id) and ->elevenlabsModel($model).
The language is forced to Swedish by default. Change it with ->elevenlabsLanguage('en') (ISO 639-1),
or pass null to let ElevenLabs detect it from the text.
Several texts in one file (e.g. a radio show)
generate() replaces what was generated before, append() adds to it. Voice can be changed between parts.
Long texts are split into chunks automatically.
Don't mix Polly and ElevenLabs in the same file, they produce different sample rates.
Delete a stored file
Installation
You can install the package via composer:
Testing
Set SAYIT_ELEVENLABS_KEY and SAYIT_ELEVENLABS_VOICE in .env to also run the ElevenLabs test.
Credits
License
The MIT License (MIT). Please see License File for more information.