PHPackages                             afaya/edge-tts - 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. afaya/edge-tts

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

afaya/edge-tts
==============

Edge TTS is a PHP package that allows access to the online text-to-speech service used by Microsoft Edge without the need for Microsoft Edge, Windows, or an API key.

1.7.0(4mo ago)151.0k↑20%5[3 issues](https://github.com/andresayac/edge-tts-php/issues)1GPL-3.0+PHPPHP &gt;=7.4 &lt;8.5

Since Oct 2Pushed 4mo ago3 watchersCompare

[ Source](https://github.com/andresayac/edge-tts-php)[ Packagist](https://packagist.org/packages/afaya/edge-tts)[ RSS](/packages/afaya-edge-tts/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (24)Used By (1)

Edge TTS PHP
============

[](#edge-tts-php)

Overview
--------

[](#overview)

**Edge TTS** is a powerful Text-to-Speech (TTS) package for PHP that leverages Microsoft Edge's speech synthesis capabilities. This package allows you to synthesize speech from text, manage voice options, and process audio streams with real-time callbacks through both programmatic and command-line interfaces.

Features
--------

[](#features)

- **Text-to-Speech**: Convert text into natural-sounding speech using Microsoft Edge's TTS capabilities.
- **Multiple Voices**: Access a wide variety of voices to suit your project's needs.
- **Real-time Streaming**: Support for audio streaming with real-time processing callbacks.
- **Word Boundaries Metadata**: Get word boundary information with precise timestamps.
- **Flexible Export Options**: Export synthesized audio in different formats (raw, base64, file, or PHP stream).
- **Command-Line Interface**: Use a simple CLI for easy access to functionality.
- **Easy Integration**: Modular structure allows for seamless inclusion in existing PHP projects.
- **Extended Compatibility**: Compatible from PHP 7.4+ to PHP 8.1+

Requirements
------------

[](#requirements)

- PHP 7.4+ (compatible up to PHP 8.1+)
- PHP Extensions: `json`, `curl`
- Composer for dependency management

Installation
------------

[](#installation)

You can install Edge TTS via Composer. Run the following command in your terminal:

```
composer require afaya/edge-tts
```

This package is a fork of the original [afaya/edge-tts](https://github.com/andresayac/edge-tts-php) package with improvements and fixes. We've downgraded the dependencies to be compatible from PHP 8.1+ to PHP 7.4+ while maintaining the original functionality .

Usage
-----

[](#usage)

### Command-Line Interface

[](#command-line-interface)

To synthesize speech from text:

```
php ./vendor/bin/edge-tts edge-tts:synthesize --text "Hello, world!"
```

To list available voices:

```
php ./vendor/bin/edge-tts edge-tts:voice-list
```

### Integration into Your Project

[](#integration-into-your-project)

```
