Download the PHP package afaya/edge-tts without Composer
On this page you can find all versions of the php package afaya/edge-tts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download afaya/edge-tts
More information about afaya/edge-tts
Files in afaya/edge-tts
Package edge-tts
Short Description 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.
License GPL-3.0+
Informations about the package edge-tts
Edge TTS PHP
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
- 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
- PHP 7.4+ (compatible up to PHP 8.1+)
- PHP Extensions:
json
,curl
- Composer for dependency management
Installation
You can install Edge TTS via Composer. Run the following command in your terminal:
This package is a fork of the original afaya/edge-tts 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
Command-Line Interface
To synthesize speech from text:
To list available voices:
Integration into Your Project
Real-time Streaming Synthesis
For real-time audio processing:
Available Methods
Audio Information
Word Boundaries Metadata
Export Options
After synthesizing speech, you can export the audio in various formats:
toBase64()
: Returns the audio as a Base64 stringtoFile($path)
: Saves the audio to a specified filetoRaw()
: Returns the raw audio streamtoStream()
: Returns a PHP stream resource
Voice Management
Audio Configuration
The package uses high-quality audio settings by default:
- Format: MP3 (audio-24khz-48kbitrate-mono-mp3)
- Sample Rate: 24kHz
- Bitrate: 48kbps
- Channels: Mono
Error Handling
The package includes comprehensive error handling:
Testing
Contributing
We welcome contributions! Please read our CONTRIBUTING.md for guidelines on how to contribute to this project.
License
This project is licensed under the GNU General Public License v3 (GPLv3).
Acknowledgments
We would like to extend our gratitude to the developers and contributors of the following projects for their inspiration and groundwork:
All versions of edge-tts with dependencies
symfony/console Version ^5.4|^6.0|^7.0
ratchet/pawl Version ^0.4.1
ramsey/uuid Version ^4.2
react/event-loop Version ^1.3