Revert default voice fallback back to Adam voice ID pNInz6obpgDQGcFmaJgB

This commit is contained in:
Hamza-Ayed
2026-05-22 23:15:29 +03:00
parent 1941a61e82
commit 7bf0933efb

View File

@@ -43,10 +43,10 @@ class GeminiService
*/ */
public static function getElevenLabsVoiceId(?string $configuredVoiceId = null): string public static function getElevenLabsVoiceId(?string $configuredVoiceId = null): string
{ {
$voiceIdSource = !empty($configuredVoiceId) ? $configuredVoiceId : (getenv('ELEVENLABS_VOICE_ID') ?: 'ErXwobaYiN019PkySvjV'); $voiceIdSource = !empty($configuredVoiceId) ? $configuredVoiceId : (getenv('ELEVENLABS_VOICE_ID') ?: 'pNInz6obpgDQGcFmaJgB');
$voiceIds = array_filter(array_map('trim', explode(',', $voiceIdSource))); $voiceIds = array_filter(array_map('trim', explode(',', $voiceIdSource)));
if (empty($voiceIds)) { if (empty($voiceIds)) {
return 'ErXwobaYiN019PkySvjV'; return 'pNInz6obpgDQGcFmaJgB';
} }
return $voiceIds[array_rand($voiceIds)]; return $voiceIds[array_rand($voiceIds)];
} }
@@ -420,7 +420,7 @@ class GeminiService
): ?array { ): ?array {
// Use ElevenLabs if the API Key is provided // Use ElevenLabs if the API Key is provided
if (!empty($elApiKey)) { if (!empty($elApiKey)) {
$voiceId = !empty($elVoiceId) ? $elVoiceId : 'ErXwobaYiN019PkySvjV'; // Default to Antoni $voiceId = !empty($elVoiceId) ? $elVoiceId : 'pNInz6obpgDQGcFmaJgB'; // Default to Adam
$audioData = self::generateAudioResponseWithElevenLabs($elApiKey, $userMessage, $voiceId); $audioData = self::generateAudioResponseWithElevenLabs($elApiKey, $userMessage, $voiceId);
if ($audioData) { if ($audioData) {
return $audioData; return $audioData;