Convert Traditional Chinese to Simplified Chinese

This commit is contained in:
2024-11-21 22:44:27 +08:00
parent 3401c59c4b
commit 3c01a76405

View File

@@ -141,12 +141,9 @@ def stream_builder(
% (info.language, info.language_probability)
)
def wrap():
last_pos = 0
with tqdm.tqdm(total=info.duration, unit="seconds", disable=True) as pbar:
for segment in segments:
start, end, text = segment.start, segment.end, segment.text
pbar.update(end - last_pos)
last_pos = end
if info.language == "zh":
segment.text = ccc.convert(segment.text)
yield segment
return wrap(), info