PHPackages                             thuanvp012van/gtts - 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. thuanvp012van/gtts

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

thuanvp012van/gtts
==================

Google Text-to-Speech for php

v1.2.0(2y ago)5362PHPPHP &gt;=8.0

Since Apr 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/thuanvp012van/gTTS)[ Packagist](https://packagist.org/packages/thuanvp012van/gtts)[ RSS](/packages/thuanvp012van-gtts/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

### Install

[](#install)

```
composer require thuanvp012van/gtts

```

### Usage

[](#usage)

1. Use with php

    ```
    use Thuanvp012van\GTTS\GTTS;
    use Thuanvp012van\GTTS\Language;

    require './vendor/autoload.php';

    $gtts = new GTTS('Xin chào mọi người', Language::VI); // or $gtts = (new GTTS('Xin chào mọi người'))->autoDetection(true);
    $gtts->save('helloworld.mp3');
    ```
2. Use with command-line

    ```
    php ./vendor/bin/gtts languages # Show all languages
    ```

    ```
    php ./vendor/bin/gtts save --file=helloworld.mp3 --language=vi 'Xin chào mọi người' # Convert text to speech.
    ```

    OR

    ```
    php ./vendor/bin/gtts save --file=helloworld.mp3 --auto-detection 'Xin chào mọi người' # Automatic language detection.
    ```

### Methods

[](#methods)

- `text(string $text)`: Set text.
- `getText()`: Get text.
- `lang(\Thuanvp012van\GTTS\Language $lang)`: Set language.
- `getLang()`: Get language.
- `autoDetection(bool $autoDetection)`: Set auto detection.
- `isAutoDetection()`: Check is auto detection.
- `topLevelDomain(string $tld)`: Set top level domain.
- `getLevelDomain()`: Get top level domain.
- `slowSpeed()`: Set slow reading speed.
- `normalSpeed()`: Set normal reading speed.
- `isSlowSpeed()`: Check is slow reading speed.
- `isNormalSpeed()`: Check is normal reading speed.
- `save(string $fileName)`: Save speech as file.
- `stream()`: Get parts of speech.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~27 days

Total

3

Last Release

1058d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b0ddc45713dbca31c4e7bee262f7730da2ed8a3c7ff5bb936d86bca6e587ff6?d=identicon)[thuanvp012](/maintainers/thuanvp012)

---

Top Contributors

[![thuanvp012van](https://avatars.githubusercontent.com/u/51852082?v=4)](https://github.com/thuanvp012van "thuanvp012van (15 commits)")

---

Tags

phpgoogletext-to-speech

### Embed Badge

![Health badge](/badges/thuanvp012van-gtts/health.svg)

```
[![Health](https://phpackages.com/badges/thuanvp012van-gtts/health.svg)](https://phpackages.com/packages/thuanvp012van-gtts)
```

###  Alternatives

[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[tomatophp/filament-seo

Manage and generate SEO tags and integrate your website with Google SEO services

112.6k1](/packages/tomatophp-filament-seo)

PHPackages © 2026

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