pvanand commited on
Commit
04addc9
1 Parent(s): 8028cc0

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -7
main.py CHANGED
@@ -545,13 +545,13 @@ async def text_to_speech_v2(request: AudioAPI.TTSRequest, api_key: str = Depends
545
  Requires API Key authentication via X-API-Key header.
546
  """
547
  try:
548
- response = openai_client.audio.speech.create(
549
- model=request.model,
550
- voice=request.voice,
551
- input=request.input,
552
- response_format="mp3" # Always set to MP3
553
- )
554
-
555
  return StreamingResponse(io.BytesIO(response.content), media_type="audio/mp3")
556
 
557
  except Exception as e:
 
545
  Requires API Key authentication via X-API-Key header.
546
  """
547
  try:
548
+ response = openai_client.audio.speech.create(
549
+ model=request.model,
550
+ voice=request.voice,
551
+ input=request.input,
552
+ response_format="mp3" # Always set to MP3
553
+ )
554
+
555
  return StreamingResponse(io.BytesIO(response.content), media_type="audio/mp3")
556
 
557
  except Exception as e: