Skip to content

Commit affc0a0

Browse files
Display the generated audio length in the mlx script. (#114)
1 parent cf97f8d commit affc0a0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/tts_mlx.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,17 @@ def main():
144144
]
145145

146146
wav_frames = queue.Queue()
147+
_frames_cnt = 0
147148

148149
def _on_frame(frame):
150+
nonlocal _frames_cnt
149151
if (frame == -1).any():
150152
return
151153
_pcm = tts_model.mimi.decode_step(frame[:, :, None])
152154
_pcm = np.array(mx.clip(_pcm[0, 0], -1, 1))
153155
wav_frames.put_nowait(_pcm)
156+
_frames_cnt += 1
157+
print(f"generated {_frames_cnt / 12.5:.2f}s", end="\r", flush=True)
154158

155159
def run():
156160
log("info", "starting the inference loop")

0 commit comments

Comments
 (0)