From affc0a052b153923dce520d9475be3db0f73c02f Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Wed, 13 Aug 2025 07:17:04 +0200 Subject: [PATCH] Display the generated audio length in the mlx script. (#114) --- scripts/tts_mlx.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/tts_mlx.py b/scripts/tts_mlx.py index 47faca6..16352e9 100644 --- a/scripts/tts_mlx.py +++ b/scripts/tts_mlx.py @@ -144,13 +144,17 @@ def main(): ] wav_frames = queue.Queue() + _frames_cnt = 0 def _on_frame(frame): + nonlocal _frames_cnt if (frame == -1).any(): return _pcm = tts_model.mimi.decode_step(frame[:, :, None]) _pcm = np.array(mx.clip(_pcm[0, 0], -1, 1)) wav_frames.put_nowait(_pcm) + _frames_cnt += 1 + print(f"generated {_frames_cnt / 12.5:.2f}s", end="\r", flush=True) def run(): log("info", "starting the inference loop")