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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pascalkleindienst/laravel-text-to-speech

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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

This is my package laravel-text-to-speech

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

Since May 31Pushed 2mo 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 today

READMEChangelog (2)Dependencies (15)Versions (9)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

35

—

LowBetter than 77% of packages

Maintenance68

Regular maintenance activity

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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

398d 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

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)

PHPackages © 2026

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