From 4c4f65e147df056adf3346290d64c7b9649b18c9 Mon Sep 17 00:00:00 2001 From: dtesniere <58301449+dtesniere@users.noreply.github.com> Date: Mon, 26 Jan 2026 10:28:20 +0100 Subject: [PATCH] No sound played without this fix on window (#174) (pre-commit hook done) --- scripts/tts_pytorch_streaming.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/tts_pytorch_streaming.py b/scripts/tts_pytorch_streaming.py index 312cc34..323fdc1 100644 --- a/scripts/tts_pytorch_streaming.py +++ b/scripts/tts_pytorch_streaming.py @@ -217,12 +217,15 @@ def main(): gen = TTSGen(tts_model, [condition_attributes], on_frame=_on_frame) - with sd.OutputStream( - samplerate=tts_model.mimi.sample_rate, - blocksize=1920, - channels=1, - callback=audio_callback, - ) and tts_model.mimi.streaming(1): + with ( + sd.OutputStream( + samplerate=tts_model.mimi.sample_rate, + blocksize=1920, + channels=1, + callback=audio_callback, + ), + tts_model.mimi.streaming(1), + ): first_turn = True for line in sys.stdin: entries = prepare_script(tts_model, line.strip(), first_turn=first_turn)