Deploy: 2026-05-23 01:28:41

This commit is contained in:
Hamza-Ayed
2026-05-23 01:28:41 +03:00
parent 57859ebd20
commit f684b58906
4 changed files with 78 additions and 19 deletions

View File

@@ -425,9 +425,20 @@ class GeminiService
if ($audioData) {
return $audioData;
}
error_log("[TTS Service] ElevenLabs failed, falling back to Gemini TTS.");
error_log("[TTS Service] ElevenLabs failed, falling back to Google Translate TTS.");
}
// Fallback to Google Translate TTS (free and reliable)
$googleTtsAudio = \App\Services\TTSService::textToSpeechArabic($userMessage);
if ($googleTtsAudio) {
return [
'audio' => $googleTtsAudio,
'mimeType' => 'audio/mp3'
];
}
error_log("[TTS Service] Google Translate TTS failed, falling back to Gemini TTS models.");
// Gemini Fallback Logic:
$models = [
'gemini-3.1-flash-tts-preview',