Spaces:
Sleeping
Sleeping
Commit ·
97e03da
1
Parent(s): 8721de0
Fix WebSocket streaming - ParlerTTSStreamer yields numpy arrays not tensors
Browse files
api.py
CHANGED
|
@@ -230,8 +230,8 @@ def generate_audio_chunks_streaming(text, speaker, pitch, rate, temperature, do_
|
|
| 230 |
# Yield audio chunks as they're generated
|
| 231 |
for audio_chunk in streamer:
|
| 232 |
if audio_chunk.shape[0] > 0:
|
| 233 |
-
#
|
| 234 |
-
audio_int16 = (audio_chunk
|
| 235 |
yield audio_int16
|
| 236 |
|
| 237 |
thread.join()
|
|
|
|
| 230 |
# Yield audio chunks as they're generated
|
| 231 |
for audio_chunk in streamer:
|
| 232 |
if audio_chunk.shape[0] > 0:
|
| 233 |
+
# ParlerTTSStreamer yields numpy arrays directly, not tensors
|
| 234 |
+
audio_int16 = (audio_chunk * 32767).astype(np.int16)
|
| 235 |
yield audio_int16
|
| 236 |
|
| 237 |
thread.join()
|