Tomtom84 commited on
Commit
52d950c
·
1 Parent(s): 60a351e
Files changed (2) hide show
  1. __pycache__/app.cpython-312.pyc +0 -0
  2. app.py +7 -5
__pycache__/app.cpython-312.pyc CHANGED
Binary files a/__pycache__/app.cpython-312.pyc and b/__pycache__/app.cpython-312.pyc differ
 
app.py CHANGED
@@ -42,12 +42,14 @@ async def websocket_tts(websocket: WebSocket):
42
  ),
43
  )
44
  )
45
- # Schreibe Audio in BytesIO
46
- audio_buffer = io.BytesIO()
47
- output.save(audio_buffer)
48
- audio_bytes = audio_buffer.getvalue()
 
 
 
49
  # Sende Audiodaten als Bytes zurück
50
  await websocket.send_bytes(audio_bytes)
51
  except WebSocketDisconnect:
52
  pass
53
-
 
42
  ),
43
  )
44
  )
45
+ # Speichere Audio temporär als Datei
46
+ temp_path = "temp.wav"
47
+ output.save(temp_path)
48
+ with open(temp_path, "rb") as f:
49
+ audio_bytes = f.read()
50
+ import os
51
+ os.remove(temp_path)
52
  # Sende Audiodaten als Bytes zurück
53
  await websocket.send_bytes(audio_bytes)
54
  except WebSocketDisconnect:
55
  pass