Spaces:
Running
Running
mrfakename
commited on
Commit
•
652c723
1
Parent(s):
7264df3
Update app.py
Browse files
app.py
CHANGED
@@ -151,6 +151,7 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence, progress
|
|
151 |
# else:
|
152 |
zh_pause_punc = r"。,、;:?!"
|
153 |
ref_text_len = len(ref_text.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, ref_text))
|
|
|
154 |
chunk = len(chunk.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, gen_text))
|
155 |
duration = ref_audio_len + int(ref_audio_len / ref_text_len * gen_text_len / speed)
|
156 |
|
|
|
151 |
# else:
|
152 |
zh_pause_punc = r"。,、;:?!"
|
153 |
ref_text_len = len(ref_text.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, ref_text))
|
154 |
+
gen_text_len = len(gen_text.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, gen_text))
|
155 |
chunk = len(chunk.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, gen_text))
|
156 |
duration = ref_audio_len + int(ref_audio_len / ref_text_len * gen_text_len / speed)
|
157 |
|