Spaces:
Runtime error
Runtime error
Update backend/rexpro_ai/routers/audio.py
Browse files
backend/rexpro_ai/routers/audio.py
CHANGED
|
@@ -429,9 +429,9 @@ async def _tts_openai(request, payload, file_path, file_body_path, user):
|
|
| 429 |
|
| 430 |
async def _tts_elevenlabs(request, payload, file_path, file_body_path, user):
|
| 431 |
"""Generate speech via the ElevenLabs TTS API."""
|
| 432 |
-
voice_id = payload.get('voice'
|
| 433 |
-
if
|
| 434 |
-
raise HTTPException(status_code=400, detail='
|
| 435 |
|
| 436 |
r = None
|
| 437 |
try:
|
|
|
|
| 429 |
|
| 430 |
async def _tts_elevenlabs(request, payload, file_path, file_body_path, user):
|
| 431 |
"""Generate speech via the ElevenLabs TTS API."""
|
| 432 |
+
voice_id = payload.get('voice') or request.app.state.config.TTS_VOICE
|
| 433 |
+
if not voice_id:
|
| 434 |
+
raise HTTPException(status_code=400, detail='Voice ID is required')
|
| 435 |
|
| 436 |
r = None
|
| 437 |
try:
|