dev-rexpro commited on
Commit
a6d7329
·
verified ·
1 Parent(s): 537a6f0

Update backend/rexpro_ai/routers/audio.py

Browse files
Files changed (1) hide show
  1. backend/rexpro_ai/routers/audio.py +3 -3
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 voice_id not in await get_available_voices(request):
434
- raise HTTPException(status_code=400, detail='Invalid voice id')
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: