Spaces:
Paused
Paused
ddd
Browse files- __pycache__/app.cpython-312.pyc +0 -0
- app.py +9 -2
__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
@@ -46,8 +46,15 @@ async def websocket_tts(websocket: WebSocket):
|
|
46 |
)
|
47 |
# Status: Generating linguistic features
|
48 |
await websocket.send_text(json.dumps({"generation_status": "Generating linguistic features"}))
|
49 |
-
#
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
audio_b64 = base64.b64encode(chunk).decode("ascii")
|
52 |
await websocket.send_text(json.dumps({
|
53 |
"data": {
|
|
|
46 |
)
|
47 |
# Status: Generating linguistic features
|
48 |
await websocket.send_text(json.dumps({"generation_status": "Generating linguistic features"}))
|
49 |
+
# Save to buffer
|
50 |
+
audio_buffer = io.BytesIO()
|
51 |
+
output.save(audio_buffer)
|
52 |
+
audio_buffer.seek(0)
|
53 |
+
chunk_size = 4096
|
54 |
+
while True:
|
55 |
+
chunk = audio_buffer.read(chunk_size)
|
56 |
+
if not chunk:
|
57 |
+
break
|
58 |
audio_b64 = base64.b64encode(chunk).decode("ascii")
|
59 |
await websocket.send_text(json.dumps({
|
60 |
"data": {
|