Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Text To Speech

Laravel Text To Speech Laravel Package

cion/laravel-text-to-speech

A Laravel package for converting text to speech with a simple API, configurable voices, and support for multiple TTS providers. Easily generate audio files from text in your Laravel apps.

View on GitHub
Deep Wiki
Context7

💬 A wrapper for popular TTS services to create a more simple & uniform API. Currently, only AWS Polly is supported.

Frequently asked questions about Laravel Text To Speech
What does the cion/laravel-text-to-speech package do?
It is a Laravel wrapper around text-to-speech services that exposes one simple, uniform API instead of vendor-specific SDK calls. It ships a service provider, config file, facade, and a driver/manager abstraction so provider selection is configuration rather than code. Currently only AWS Polly is implemented, so in practice it is an AWS Polly wrapper with room for additional drivers.
Which TTS providers does this Laravel package support?
Only AWS Polly ships today; the abstraction is designed for multiple providers but no other drivers are included. Provider-specific features such as SSML, voice IDs, and output formats are handled inside the Polly driver. If you need Google, Azure, ElevenLabs, or OpenAI, you would have to write and maintain those drivers yourself.
How do I install and configure laravel-text-to-speech?
Install it with composer require cion/laravel-text-to-speech, then publish the config file using php artisan vendor:publish. Add your AWS credentials and region to your .env file, since Polly authentication runs through the AWS SDK. Laravel package auto-discovery registers the service provider and facade for you.
Does this package support Laravel 11 and Laravel 12?
That is unconfirmed. The last release was December 2023, so the illuminate/* constraints most likely target Laravel 9 and 10 with PHP 8.1 or 8.2. Check composer.json before committing, and expect to either fork with widened constraints or avoid installing it on newer Laravel versions.
Does the package return audio bytes, a file path, or a URL?
The package is a thin orchestration layer over the TTS API, so what you get back depends on how the driver is invoked. It does not solve storage, CDN delivery, or caching, which remain your responsibility. Verify the return type in the source before designing your pipeline around it.
Can I queue text-to-speech generation as a background job in Laravel?
The package itself is synchronous, so queueing is your responsibility. The standard approach is to wrap the TTS call in a queued job so long text does not block a request. This is also advisable because Polly enforces character limits per request, and you will usually want to chunk long input.
How do I change the voice, language, or speaking rate?
Voice and language are configured in the published config file and passed through to the Polly driver. Per-call overrides depend on how the driver is written, so check the source. Speaking rate and pitch are Polly-specific and may require SSML, which a shared interface may not normalize across providers.
How do I test the package without calling AWS Polly?
There is no documented test suite or built-in provider mocking, so plan to write your own tests. Mock the facade or the underlying AWS client rather than hitting live Polly from CI. Treat any integration test that calls the real API as opt-in and credential-gated.
Is cion/laravel-text-to-speech safe to use in production?
Treat it as a reference implementation rather than a hardened dependency. It has a single maintainer, no release since December 2023, zero dependents, around 43 stars, and no visible security policy. It is fine for a proof of concept, but for production you should fork it, verify provider SDK compatibility, and own the maintenance.
What are the alternatives if I need multi-provider TTS or streaming audio?
For AWS-only needs, calling the AWS SDK directly removes the abstraction layer entirely. For OpenAI, packages like openai-php give you TTS without a wrapper. There is no dominant multi-provider TTS package in the Laravel ecosystem, so many teams build a small internal abstraction tailored to the controls and providers they actually use.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib