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.
guzzlehttp/guzzle (for HTTP requests to Edge’s internal API).EdgeTTS::textToSpeech()) with basic params:
EdgeTTS::textToSpeech('Hello world', 'en-US', 'output.mp3');
| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Edge Dependency | Critical | Requires Windows + Edge on server; use Docker with Windows containers or a VM. |
| No API Key | Medium | Relies on Edge’s internal API (could break if Microsoft changes Edge’s internals). |
| Performance | High | Edge TTS is CPU-intensive; may throttle under load. Test with expected workload. |
| Cross-Platform | High | Linux/macOS servers cannot run Edge natively without workarounds (e.g., Wine, VMs). |
| Maintenance | Medium | Package is untested (2 stars, no contributors). Risk of abandonment. |
| Security | Low | No auth required for Edge’s internal API (assumes local-only usage). |
responsivevoice/responsive-voice, AWS Polly, or local engines like eSpeak)?Dockerfile:
FROM mcr.microsoft.com/windows/servercore:ltsc2022
RUN powershell -Command Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/?linkid=2124763" -OutFile "edge_installer.exe"; Start-Process -Wait -FilePath "edge_installer.exe" -ArgumentList "/silent", "/install"; Remove-Item "edge_installer.exe"
# Install PHP/Laravel...
composer require bestmomo/laravel-edge-tts
// config/app.php
'aliases' => [
'EdgeTTS' => Bestmomo\LaravelEdgeTts\Facades\EdgeTTS::class,
];
Route::get('/tts', function () {
$path = EdgeTTS::textToSpeech('Hello world', 'en-US', storage_path('app/output.mp3'));
return response()->file($path);
});
try {
$path = EdgeTTS::textToSpeech($text, $locale, $outputPath);
} catch (EdgeTTSException $e) {
$path = fallbackTTS($text, $locale, $outputPath); // Custom logic
}
How can I help you explore Laravel packages today?