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(3y ago)5362PHPPHP &gt;=8.0

Since Apr 25Pushed 3y ago1 watchersCompare

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

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 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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

1109d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51852096?v=4)[thuanvp012](/maintainers/thuanvp012)[@thuanvp012](https://github.com/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

[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

5.1k5.2k](/packages/shlinkio-shlink)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[eliashaeussler/typo3-solver

Solver - Extends TYPO3's exception handling with AI generated solutions. Problems can also be solved from command line. Several OpenAI parameters are configurable and prompts and solution providers can be customized as desired.

302.1k](/packages/eliashaeussler-typo3-solver)

PHPackages © 2026

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