From 54211610be4f2969f7b9d7333708a2c052379f66 Mon Sep 17 00:00:00 2001 From: Damien TESNIERE Date: Sun, 25 Jan 2026 02:44:32 +0100 Subject: [PATCH] No sound played without this fix on window (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 audio_callback(outdata, _a, _b, _c): 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)