PHPackages                             pascalkleindienst/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. pascalkleindienst/laravel-text-to-speech

ActiveLibrary

pascalkleindienst/laravel-text-to-speech
========================================

This is my package laravel-text-to-speech

v0.3.0(11mo ago)081[4 PRs](https://github.com/PascalKleindienst/laravel-text-to-speech/pulls)MITPHPPHP ^8.3CI passing

Since May 31Pushed 1mo agoCompare

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

READMEChangelog (2)Dependencies (15)Versions (8)Used By (0)

🎵 Laravel Text To Speech
========================

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/af1f3919137b1f06d0823d9b1713342b74fd89a33c13d6ad062031f285e4bb87/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70617363616c6b6c65696e6469656e73742f6c61726176656c2d746578742d746f2d7370656563682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pascalkleindienst/laravel-text-to-speech)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d22edd91b9d54ed1f7bf915352c7af9d7fc61beb363a136b3e5c92274f977c6f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70617363616c6b6c65696e6469656e73742f6c61726176656c2d746578742d746f2d7370656563682f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/pascalkleindienst/laravel-text-to-speech/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/33e8f400b111aeb4fbcee936e76486528d72a835b820e91d58cf5a26b00a5a2f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70617363616c6b6c65696e6469656e73742f6c61726176656c2d746578742d746f2d7370656563682f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/pascalkleindienst/laravel-text-to-speech/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/169988f61d54599b9fef372129055fe8a3631a947f8015bbb3ce20809fd53d1f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70617363616c6b6c65696e6469656e73742f6c61726176656c2d746578742d746f2d7370656563682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pascalkleindienst/laravel-text-to-speech)

A simple and elegant Laravel package that converts text to speech using various TTS engines. Easily integrate voice synthesis into your Laravel applications with support for multiple languages, voices, and audio formats.

### Features

[](#features)

- 🎤 Multiple TTS engine support
- 🌍 Multi-language compatibility
- 🔊 Customizable voice options
- ⚡️ Simple, fluent API
- 🚀 Easy Laravel integration

Perfect for creating accessible applications, voice notifications, audiobooks, or any project requiring speech synthesis.

📖️ Installation
---------------

[](#️-installation)

You can install the package via composer:

```
composer require pascalkleindienst/laravel-text-to-speech
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-text-to-speech-config"
```

This is the contents of the published config file:

```
return [
    'driver' => env('TEXT_TO_SPEECH_DRIVER'),
    'language' => env('TEXT_TO_SPEECH_LANGUAGE'),

    'audio' => [
        'path' => env('TEXT_TO_SPEECH_AUDIO_PATH', 'audio'),
        'format' => env('TEXT_TO_SPEECH_AUDIO_FORMAT', 'mp3'),
        'disk' => env('TEXT_TO_SPEECH_AUDIO_DISK', 'local'),
    ],

    'google' => [
        'private_key' => env('TEXT_TO_SPEECH_GOOGLE_PRIVATE_KEY'),
        'type' => env('TEXT_TO_SPEECH_GOOGLE_TYPE', 'service_account'),
        'client_email' => env('TEXT_TO_SPEECH_GOOGLE_CLIENT_EMAIL'),
        'voice' => env('TEXT_TO_SPEECH_GOOGLE_VOICE', 'de-DE-Chirp3-HD-Achernar'),
    ],

    'polly' => [
        'key' => env('TEXT_TO_SPEECH_POLLY_KEY'),
        'secret' => env('TEXT_TO_SPEECH_POLLY_SECRET'),
        'token' => env('TEXT_TO_SPEECH_POLLY_TOKEN', false),
        'version' => env('TEXT_TO_SPEECH_POLLY_VERSION', 'latest'),
        'region' => env('TEXT_TO_SPEECH_POLLY_REGION', 'us-east-1'),
        'format' => env('TEXT_TO_SPEECH_POLLY_FORMAT', 'mp3'),
        'engine' => env('TEXT_TO_SPEECH_POLLY_ENGINE', 'standard'),
        'voice' => env('TEXT_TO_SPEECH_POLLY_VOICE', 'Joanna'),
        'text_type' => env('TEXT_TO_SPEECH_POLLY_TEXT_TYPE', 'text'),
    ],

    'system' => [
        'rate' => env('TEXT_TO_SPEECH_SYSTEM_RATE', 175),
        'pitch' => env('TEXT_TO_SPEECH_SYSTEM_PITCH', 50),
        'volume' => env('TEXT_TO_SPEECH_SYSTEM_VOLUME', 100),
        'voice' => env('TEXT_TO_SPEECH_SYSTEM_VOICE', 'german-mbrola-1'),
    ],
];
```

### Driver Prequisites

[](#driver-prequisites)

#### System Driver

[](#system-driver)

When using the system driver, you need to install the following packages:

- [espeak-ng](https://github.com/espeak-ng/espeak-ng)

#### Google Driver

[](#google-driver)

When using the google driver, you need to install the following packages:

```
composer require google/cloud-text-to-speech
```

💻 Usage
-------

[](#-usage)

```
use PascalKleindienst\LaravelTextToSpeech\Facades\TextToSpeech;
use PascalKleindienst\LaravelTextToSpeech\Source;

// The text is converted to speech and stored in a file (configured in the "audio" config).
TextToSpeech::convert('Hello World!');

// The text is converted to speech and additionallystored in the given file.
TextToSpeech::convert('Hello World!')->save('path/to/file.mp3');

// Store the converted text on a different disk
TextToSpeech::convert('Hello World!')->disk('s3')->save('path/to/file.txt');

// convert text from a file
TextToSpeech::from(Source::File)->convert('path/to/file.txt');

/**
 * Change the language and/or voice used for the speech.
 * NOTE:
 *   This will overwrite the language and voice settings in the config file.
 *   Also the format for the language might be different for each engine, e.g. de vs de-DE
 */
TextToSpeech::language('de-DE')->voice('male')->convert('Hallo Welt!');

// Use the system engine to convert text to speech, needs espeak-ng to be installed
TextToSpeech::engine('system')->convert('Hello System Engine!');

// Use the Google engine to convert text to speech, needs google cloud sdk to be installed
TextToSpeech::engine('google')->convert('Hello Google Engine!');
```

👨‍🔬 Testing
-----------

[](#‍-testing)

```
composer test
```

📝 Changelog
-----------

[](#-changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Pascal Kleindienst](https://github.com/PascalKleindienst)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance72

Regular maintenance activity

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~1 days

Total

3

Last Release

346d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/367c097ec42aec6ed007853fbec64d138734606e71574341f970e273b3efe7fd?d=identicon)[PascalKleindienst](/maintainers/PascalKleindienst)

---

Top Contributors

[![PascalKleindienst](https://avatars.githubusercontent.com/u/3470866?v=4)](https://github.com/PascalKleindienst "PascalKleindienst (32 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravelPascal Kleindienstlaravel-text-to-speech

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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