Skip to content

Commit b331930

Browse files
Refactor frame callback to remove last_time tracking (#125)
* Refactor frame callback to remove last_time tracking Removed unnecessary time tracking in the frame callback. * Formatting.
1 parent 2d301c9 commit b331930

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

scripts/tts_pytorch.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,13 @@ def audio_callback(outdata, _a, _b, _c):
117117
break
118118
time.sleep(1)
119119
else:
120-
last_time = time.time()
121120

122121
def _on_frame(frame):
123122
nonlocal _frames_cnt
124123
nonlocal last_time
125124
if (frame != -1).all():
126125
_frames_cnt += 1
127126
print(f"generated {_frames_cnt / 12.5:.2f}s", end="\r", flush=True)
128-
print("{}", time.time() - last_time)
129-
last_time = time.time()
130127

131128
start_time = time.time()
132129
result = tts_model.generate(

0 commit comments

Comments
 (0)