mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-14 02:38:07 +02:00
Fix Edge TTS voice fallback and Gemini voice validation
- Edge TTS fallback list now includes fr-FR-RemyMultilingualNeural - Removed 'Neural not in voice' check that rejected Gemini voices (fr-FR-Standard-A etc) before falling back - these are valid voices and Edge-tts handles them properly - Improved is_male check to match 'Remy' not 'Remi'
This commit is contained in:
1 parent
a2c2753b0b
commit
64fe3810b5
1 file changed
+8
-3
@@ -325,17 +325,19 @@ async def generate_tts_with_subs(
|
||||
providing millisecond-accurate subtitle timing.
|
||||
"""
|
||||
# Determine gender of requested voice to choose appropriate fallbacks
|
||||
is_male = any(name in voice for name in ["Remi", "Henri", "Paul"])
|
||||
is_male = any(name in voice for name in ["Remy", "Henri", "Paul"])
|
||||
|
||||
if is_male:
|
||||
fallback_voices = [
|
||||
voice,
|
||||
"fr-FR-RemyMultilingualNeural",
|
||||
"fr-FR-HenriNeural",
|
||||
"fr-FR-PaulNeural",
|
||||
]
|
||||
else:
|
||||
fallback_voices = [
|
||||
voice,
|
||||
"fr-FR-VivienneMultilingualNeural",
|
||||
"fr-FR-VivienneNeural",
|
||||
"fr-FR-DeniseNeural",
|
||||
]
|
||||
@@ -920,8 +922,9 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)):
|
||||
voice = "fr-FR-RemyMultilingualNeural"
|
||||
elif voice == "female":
|
||||
voice = "fr-FR-VivienneMultilingualNeural"
|
||||
elif not voice or "Neural" not in voice:
|
||||
elif not voice:
|
||||
voice = "fr-FR-VivienneMultilingualNeural"
|
||||
# Note: Gemini voices (fr-FR-Standard-A etc.) are valid Edge voices too
|
||||
print(f"🔊 Using voice: {voice}")
|
||||
|
||||
if tts_clean_text:
|
||||
@@ -1320,8 +1323,10 @@ async def preview_tts(request: ReelRequest, x_api_key: str = Header(None)):
|
||||
voice = "fr-FR-RemyMultilingualNeural"
|
||||
elif voice == "female":
|
||||
voice = "fr-FR-VivienneMultilingualNeural"
|
||||
elif not voice or "Neural" not in voice:
|
||||
elif not voice:
|
||||
voice = "fr-FR-VivienneMultilingualNeural"
|
||||
# Note: Gemini voices (fr-FR-Standard-A etc.) are valid Edge voices too,
|
||||
# so we don't check for "Neural" - let edge_tts handle voice resolution
|
||||
|
||||
engine = request.tts_engine or "edge"
|
||||
|
||||
|
||||
Reference in new issue
Block a user