{"id":17437161,"url":"https://github.com/andresayac/edge-tts-php","last_synced_at":"2025-04-16T22:25:36.027Z","repository":{"id":257807422,"uuid":"866702590","full_name":"andresayac/edge-tts-php","owner":"andresayac","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.","archived":false,"fork":false,"pushed_at":"2024-10-16T15:39:39.000Z","size":122,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-16T07:44:37.473Z","etag":null,"topics":["edge-tts","php","speech-synthesis","text-to-speech","tts"],"latest_commit_sha":null,"homepage":"https://edge-tts.dayax.net/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andresayac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-02T18:14:42.000Z","updated_at":"2025-04-08T11:14:01.000Z","dependencies_parsed_at":"2024-10-18T02:19:06.956Z","dependency_job_id":null,"html_url":"https://github.com/andresayac/edge-tts-php","commit_stats":null,"previous_names":["andresayac/edge-tts","andresayac/edge-tts-php"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresayac%2Fedge-tts-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresayac%2Fedge-tts-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresayac%2Fedge-tts-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresayac%2Fedge-tts-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andresayac","download_url":"https://codeload.github.com/andresayac/edge-tts-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249220440,"owners_count":21232419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["edge-tts","php","speech-synthesis","text-to-speech","tts"],"created_at":"2024-10-17T11:06:14.323Z","updated_at":"2025-04-16T22:25:36.009Z","avatar_url":"https://github.com/andresayac.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Edge TTS\n\n## Overview\n\n**Edge TTS** is a powerful Text-to-Speech (TTS) package for PHP that leverages Microsoft's Edge capabilities. This package allows you to synthesize speech from text and manage voice options easily through a command-line interface (CLI).\n\n## Features\n\n- **Text-to-Speech**: Convert text into natural-sounding speech using Microsoft Edge's TTS capabilities.\n- **Multiple Voices**: Access a variety of voices to suit your project's needs.\n- **Audio Export Options**: Export synthesized audio in different formats (raw, base64, or directly to a file).\n- **Command-Line Interface**: Use a simple CLI for easy access to functionality.\n- **Easy Integration**: Modular structure allows for easy inclusion in existing PHP projects.\n\n\nCommand-Line Interface: Use a simple CLI for easy access to functionality.\nEasy Integration: Modular structure allows for easy inclusion in existing PHP projects.\n\n## Installation\n\nYou can install Edge TTS via Composer. Run the following command in your terminal:\n\n```bash\ncomposer require afaya/edge-tts\n```\n\n## Usage\nCommand-Line Interface\nTo synthesize speech from text, use the following command:\n\n```bash\nphp .\\vendor\\bin\\edge-tts edge-tts:synthesize --text \"Hello, world!\"\n```\n\nTo list available voices, run:\n\n```bash\nphp .\\vendor\\bin\\edge-tts edge-tts:voice-list\n```\n\n\n## Integration into Your Project\nTo use Edge TTS in your PHP project, include the autoload file:\n\n```php\n\u003c?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse Afaya\\EdgeTTS\\Service\\EdgeTTS;\n\n// Initialize the EdgeTTS service\n$tts = new EdgeTTS();\n\n// Get voices\n$voices = $tts-\u003egetVoices();  \n// var_dump($voices);  // array -\u003e use ShortName with the name of the voice\n\n// Synthesize text with options for voice, rate, volume, and pitch\n$tts-\u003esynthesize(\"Hello, world!\", 'en-US-AriaNeural', [\n    'rate' =\u003e '0%',       // Speech rate (range: -100% to 100%)\n    'volume' =\u003e '0%',     // Speech volume (range: -100% to 100%)\n    'pitch' =\u003e '0Hz'      // Voice pitch (range: -100Hz to 100Hz)\n]);\n\n// Export synthesized audio in different formats\n$base64Audio = $tts-\u003etoBase64();   // Get audio as base64\n$tts-\u003etoFile(\"output.wav\");        // Save audio to file\n$rawAudio = $tts-\u003etoRaw();         // Get raw audio stream\n```\n\n## Export Options\nAfter synthesizing speech, you can export the audio in various formats:\n\n- ```toBase64```: Returns the audio as a Base64 string.\n- ```toFile```: Saves the audio to a specified file (e.g., \"output.wav\").\n- ```toRaw```: Returns the raw audio stream.\n\n## Testing\n```bash\n./vendor/bin/phpunit\n```\n\n\n## Contributing\nWe welcome contributions! Please read our CONTRIBUTING.md for guidelines on how to contribute to this project.\n\n## License\nThis project is licensed under the GNU General Public License v3 (GPLv3).\n\n## Acknowledgments\n\nWe would like to extend our gratitude to the developers and contributors of the following projects for their inspiration and groundwork:\n\n* https://github.com/rany2/edge-tts/tree/master/examples\n* https://github.com/rany2/edge-tts/blob/master/src/edge_tts/util.py\n* https://github.com/hasscc/hass-edge-tts/blob/main/custom_components/edge_tts/tts.py","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandresayac%2Fedge-tts-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandresayac%2Fedge-tts-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandresayac%2Fedge-tts-php/lists"}