Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Edge Tts

Laravel Edge Tts Laravel Package

bestmomo/laravel-edge-tts

Laravel package integrating Microsoft Edge Text-to-Speech with streaming output, optional MP3 caching via Laravel storage, configurable default voice, and route security via middleware (auth/throttle). Provides a contract and facade, built on edge-tts-php.

View on GitHub
Deep Wiki
Context7

Allows access to the online text-to-speech service used by Microsoft Edge without the need for Microsoft Edge, Windows, or an API key.

Frequently asked questions about Laravel Edge Tts
Can I use this package on Linux servers or cloud platforms like AWS/GCP?
No, this package requires Microsoft Edge to be installed on the server, which is Windows-only. You’d need a Windows-based environment (e.g., a VM, Docker Windows container, or shared Windows hosting) to run it. Linux-based cloud platforms like AWS or GCP are not supported without workarounds like Wine or virtualization.
How do I install and configure the package for Laravel?
First, run `composer require bestmomo/laravel-edge-tts`, then publish the config file with `php artisan vendor:publish --tag=edge-tts-config`. Edit `config/edge-tts.php` to set your default voice, middleware (e.g., auth, throttle), caching settings, and logging preferences. Ensure Microsoft Edge is installed on your server.
What Laravel versions does this package support?
This package requires **PHP 8.1+** and is built for **Laravel 9+**. If you’re using an older Laravel version, you’ll need to upgrade or check for compatibility updates, as the package leverages modern Laravel features like contracts and facades.
How do I generate and stream audio using the package?
Use the facade `EdgeTTS::textToSpeech('Your text', 'voice-code', 'output.mp3')` or inject the `TtsSynthesizer` contract. The package automatically handles streaming via a dedicated route (configurable with middleware). For caching, set `cache.enabled` to `true` in the config and specify a Laravel disk (e.g., `local`, `s3`).
Is there a way to secure the TTS streaming route?
Yes, the package includes middleware support for the streaming route. In `config/edge-tts.php`, define an array of middleware like `['auth', 'throttle:60,1']` to restrict access. This ensures only authenticated or rate-limited users can generate audio, protecting your API from abuse.
Can I cache generated MP3 files to improve performance?
Absolutely. Enable caching by setting `'cache.enabled' => true` in the config and specify a Laravel disk (e.g., `local`, `s3`). Optionally, set `'cache.lifetime'` to define how long cached files should persist. The package stores MP3s in the configured disk and serves them directly for repeated requests.
What happens if Microsoft Edge’s TTS API changes or breaks?
This package relies on the underlying `andresayac/edge-tts-php` library, which interacts with Edge’s internal API. If Microsoft modifies or deprecates Edge’s TTS functionality, the package may break. Monitor updates to the base library and consider fallback mechanisms (e.g., cloud TTS services) if reliability is critical.
Are there alternatives to this package for Laravel TTS?
Yes. For cloud-based TTS, consider packages like `spatie/laravel-aws-polly` (AWS Polly) or `responsivevoice/responsive-voice` (browser-based). For local TTS on Linux, explore `espeak` or `festvox`. However, these alternatives may require API keys, subscriptions, or different deployment setups compared to Edge TTS’s local-first approach.
How do I handle concurrent requests or high traffic with Edge TTS?
Edge TTS is not thread-safe by default, so concurrent requests may cause performance issues or failures. Use middleware like `throttle` to limit requests, and consider offloading generation to Laravel queues if processing heavy text. For high-scale needs, evaluate cloud TTS services instead, as they’re designed for horizontal scaling.
Does this package support advanced TTS features like SSML or voice customization?
No, this package wraps Microsoft Edge’s basic TTS functionality, which lacks advanced features like SSML (Speech Synthesis Markup Language) or prosody control. If you need these, consider cloud-based TTS services (e.g., AWS Polly, Google Cloud Text-to-Speech) or local engines like `espeak` with custom scripts.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle