Skip to content

SOTA Open Source TTS

Fix streaming in webui (#643)

haopeng5c7e39726924
diff --git a/tools/webui.py b/tools/webui.py
index ffe52da..6863c63 100644
--- a/tools/webui.py
+++ b/tools/webui.py
@@ -146,7 +146,9 @@ def inference(
segments.append(fake_audios)
if streaming:
- yield (fake_audios * 32768).astype(np.int16).tobytes(), None, None
+ wav_header = wav_chunk_header()
+ audio_data = (fake_audios * 32768).astype(np.int16).tobytes()
+ yield wav_header + audio_data, None, None
if len(segments) == 0:
return (