ekandreas/sayit

Converts text to speech via AWS and place it in a S3 bucket folder

Fund package maintenance!
ekandreas

1.3 2022-12-28 14:16 UTC

This package is auto-updated.

Last update: 2024-04-28 17:12:59 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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:

  1. composer require ekandreas/sayit
  2. Register an IAM programmatic account and set policy S3 full access and Polly Full Access to it.
  3. Use the key, secret, region and bucket name with the factory helper.
  4. Open a public folder in your S3 bucket and create a folder in it.

Code example:

$factory = TextToSpeech::make(
    $aws_key,
    $aws_secret,
    $aws_region,
    $aws_bucket
)
    ->voice("Elin")
    ->engine('neural')
    ->generate("Hej på dig, det här kommer att läsas upp i en mp3 efter generering.")
    ->store("your-folder");

// the url now points to a public s3 folder "your-folder" with a unique mp3 file generated from the text above.
$url = $factory->url();

Installation

You can install the package via composer:

composer require ekandreas/sayit

Testing

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.