PHPackages                             cion/laravel-text-to-speech - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. cion/laravel-text-to-speech

ActiveLibrary[API Development](/categories/api)

cion/laravel-text-to-speech
===========================

This package creates a shared API to easily use Text to Speech functionalities amongst different TTS providers.

v1.5.2(2y ago)4228.3k↓47.1%18[4 issues](https://github.com/meemalabs/laravel-text-to-speech/issues)[3 PRs](https://github.com/meemalabs/laravel-text-to-speech/pulls)MITPHPPHP ^7.3|^7.4|^8.0CI failing

Since May 17Pushed 1y ago4 watchersCompare

[ Source](https://github.com/meemalabs/laravel-text-to-speech)[ Packagist](https://packagist.org/packages/cion/laravel-text-to-speech)[ Docs](https://github.com/meemalabs/laravel-text-to-speech)[ RSS](/packages/cion-laravel-text-to-speech/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (14)Used By (0)

Text-To-Speech Package for Laravel
==================================

[](#text-to-speech-package-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e39f712e1d47d793d8df817c0bfa046e2c43a7c3416220ffbcf34f2893202d84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63696f6e2f6c61726176656c2d746578742d746f2d7370656563682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cion/laravel-text-to-speech)[![Test](https://github.com/ci-on/laravel-text-to-speech/workflows/Test/badge.svg?branch=master)](https://github.com/ci-on/laravel-text-to-speech/actions)[![StyleCI](https://camo.githubusercontent.com/0e6f96d4fbd66448ae7285f9922c4144b2116001c1a3324bbf9a6f00caed030e/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3236343537383137312f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/264578171)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d03741797cf3010ba3c59174e9645a658a4b9eaf6ef7dac8111a3cbcc080f6da/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f63692d6f6e2f6c61726176656c2d746578742d746f2d7370656563682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ci-on/laravel-text-to-speech/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/270e93c20ce1bdabe27134a4c917150a2847f787b93c8f6dba0e909cf13e9434/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63696f6e2f6c61726176656c2d746578742d746f2d7370656563682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cion/laravel-text-to-speech)[![License](https://camo.githubusercontent.com/811ad90940b098d3fdf4c158f41112d20ea0a07ab663298fc75648c600660a93/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f63692d6f6e2f6c61726176656c2d746578742d746f2d7370656563682e7376673f7374796c653d666c61742d737175617265)](https://github.com/ci-on/laravel-text-to-speech/blob/master/LICENSE.md)

This is a Text-To-Speech package for Laravel. Its primary intention is to use a shared API to easily convert text to speech.

Currently, the only supported driver is Amazon Polly. We are exploring the option to soon support Google WaveNet. Feel free to start a discussion on any possible driver.

💡 Usage
-------

[](#-usage)

```
use Cion\TextToSpeech\Facades\TextToSpeech;

// convert text from a text file
$path = TextToSpeech::source('path')
    ->convert('/path/to/text/file');

// you may also pass the string directly to convert() method
$path = TextToSpeech::convert('Convert this string.');

// configure where to save the converted output. In this case, it would save the output file in the storage/output.mp3
$path = TextToSpeech::saveTo('output.mp3')
    ->convert('Hi this is a test.');

// store the converted output directly to S3
$path = TextToSpeech::disk('s3')
    ->saveTo('output.mp3')
    ->convert('Store me to S3.');

// convert website articles & blog posts to an audio file
$path = TextToSpeech::source('website')
    ->convert('https://medium.com/cloud-academy-inc/an-introduction-to-aws-polly-s3-and-php-479490bffcbd');

/**
 * Change the language to be used for the conversion.
 * Note: every language has a specific voice_id.
 * For example in ja-JP language we need to use either Mizuki or Takumi.
 *
 * We can pass an option array in convert to change the voice_id to be used
 **/
$options = ['voice' => 'Takumi'];
$path = TextToSpeech::language('ja-JP')
    ->convert('これはテストです', $options);

// use the SSML text type in the convert() method.
$path = TextToSpeech::ssml()
    ->convert('Hi There  This is SSML syntax env('TTS_DISK', 'local'),

    /**
     * The default audio format of the converted text-to-speech audio file.
     * Currently, mp3 is the only supported format.
     */
    'output_format' => env('TTS_OUTPUT_FORMAT', 'mp3'),

    /**
     * The driver to be used for converting text-to-speech
     * You can choose polly, or null as of now.
     */
    'driver' => env('TTS_DRIVER', 'polly'),

    /**
     * The default language to be used.
     *
     * You may use any of the following:
     *
     * arb, cmn-CN, cy-GB, da-DK, de-DE, en-AU, en-GB, en-GB-WLS, en-IN, en-US,
     * es-ES, es-MX, es-US, fr-CA, fr-FR, is-IS, it-IT, ja-JP, hi-IN, ko-KR, nb-NO,
     * nl-NL, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sv-SE, tr-TR
     */
    'language' => env('TTS_LANGUAGE', 'en-US'),

    'audio' => [
        /**
         * Default path to store the output file.
         */
        'path' => 'TTS',

        /**
         * Default filename formatter.
         */
        'formatter' => \Cion\TextToSpeech\Formatters\DefaultFilenameFormatter::class,
    ],

    /**
     * The default source that will be used.
     */
    'default_source' => 'text',

    /**
     * The default text type to be used.
     * You can use either text or ssml.
     */
    'text_type' => env('TTS_TEXT_TYPE', 'text'),

    /**
     * The source that can be used.
     * You can create your own source by implementing the Source interface.
     *
     * @see \Cion\TextToSpeech\Contracts\Source
     */
    'sources' => [
        'text'    => \Cion\TextToSpeech\Sources\TextSource::class,
        'path'    => \Cion\TextToSpeech\Sources\PathSource::class,
        'website' => \Cion\TextToSpeech\Sources\WebsiteSource::class,
    ],

    'services' => [
        'polly' => [
            /**
             * Voice ID to use for the synthesis.
             * You may use any of the following:.
             *
             * Aditi, Amy, Astrid, Bianca, Brian, Camila, Carla, Carmen, Celine,
             * Chantal, Conchita, Cristiano, Dora, Emma, Enrique, Ewa, Filiz,
             * Geraint, Giorgio, Gwyneth, Hans, Ines, Ivy, Jacek, Jan, Joanna,
             * Joey, Justin, Karl, Kendra, Kimberly, Lea, Liv, Lotte, Lucia,
             * Lupe, Mads, Maja, Marlene, Mathieu, Matthew, Maxim, Mia, Miguel,
             * Mizuki, Naja, Nicole, Penelope, Raveena, Ricardo, Ruben, Russell,
             * Salli, Seoyeon, Takumi, Tatyana, Vicki, Vitoria, Zeina, Zhiyu.
             */
            'voice_id' => env('AWS_VOICE_ID', 'Amy'),

            /**
             * You can request any or all of the speech mark types, but leave it empty if you don't use speech marks.
             * You may add any of the following:.
             *
             * sentence, word, viseme, ssml
             */
            'speech_marks' => [],

            /**
             * IAM Credentials from AWS.
             */
            'credentials' => [
                'key'     => env('AWS_ACCESS_KEY_ID', ''),
                'secret'  => env('AWS_SECRET_ACCESS_KEY', ''),
            ],

            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
            'version' => 'latest',
        ],
    ],

];
```

🧪 Testing
---------

[](#-testing)

```
composer test
```

📈 Changelog
-----------

[](#-changelog)

Please see our [releases](https://github.com/meemalabs/laravel-text-to-speech/releases) page for more information on what has changed recently.

💪🏼 Contributing
---------------

[](#-contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

🏝 Community
-----------

[](#-community)

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

[Text-to-Speech on GitHub](https://github.com/meemalabs/laravel-text-to-speech/discussions)

For casual chit-chat with others using this package:

[Join the Meema Discord Server](https://discord.meema.io)

🚨 Security
----------

[](#-security)

Please review [our security policy](https://github.com/meemalabs/laravel-text-to-speech/security/policy) on how to report security vulnerabilities.

🙏🏼 Credits
----------

[](#-credits)

- [Chris Breuer](https://github.com/Chris1904)
- [Rigel Kent Carbonel](https://github.com/luigel)
- [Harlequin Doyon](https://github.com/harlekoy)
- [Folks at Meema Labs &amp; CION](https://github.com/meemalabs)
- [All Contributors](../../contributors)

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.

Made with ❤️ by Meema, Inc.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 79.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~118 days

Recently: every ~244 days

Total

12

Last Release

888d ago

PHP version history (2 changes)v1.0.0PHP ^7.0|^7.2|^7.3|^7.4

1.3.0PHP ^7.3|^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/de07690de2553699527128313334559d401e905d28abb6df039f3a410d2d0810?d=identicon)[luigel](/maintainers/luigel)

---

Top Contributors

[![luigel](https://avatars.githubusercontent.com/u/26235960?v=4)](https://github.com/luigel "luigel (79 commits)")[![chrisbbreuer](https://avatars.githubusercontent.com/u/6228425?v=4)](https://github.com/chrisbbreuer "chrisbbreuer (16 commits)")[![brianrlewis](https://avatars.githubusercontent.com/u/31142584?v=4)](https://github.com/brianrlewis "brianrlewis (1 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![etopian](https://avatars.githubusercontent.com/u/273319?v=4)](https://github.com/etopian "etopian (1 commits)")[![yurik94](https://avatars.githubusercontent.com/u/13189646?v=4)](https://github.com/yurik94 "yurik94 (1 commits)")

---

Tags

awscionlaravelmeemapollytext-to-speechttslaravelawstext-to-speechcionpollywavenetmeemalabs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cion-laravel-text-to-speech/health.svg)

```
[![Health](https://phpackages.com/badges/cion-laravel-text-to-speech/health.svg)](https://phpackages.com/packages/cion-laravel-text-to-speech)
```

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[dcblogdev/laravel-xero

A Laravel Xero package

53129.1k1](/packages/dcblogdev-laravel-xero)[joggapp/laravel-aws-sns

Laravel package for the SNS events by AWS

3171.8k](/packages/joggapp-laravel-aws-sns)[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
