Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -212,7 +212,7 @@ def infer_batch(ref_audio, ref_text, gen_text_batches, exp_name, remove_silence,
|
|
212 |
gen_text_len = len(gen_text.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, gen_text))
|
213 |
|
214 |
# Calculate duration based on the lengths of ref_text and gen_text
|
215 |
-
duration = min(2000, max(270, (ref_audio_len +
|
216 |
|
217 |
# Print the calculated duration
|
218 |
print(f"Duration: {duration} seconds")
|
|
|
212 |
gen_text_len = len(gen_text.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, gen_text))
|
213 |
|
214 |
# Calculate duration based on the lengths of ref_text and gen_text
|
215 |
+
duration = min(2000, max(270, int(0.75 * (ref_audio_len + ref_audio_len / ref_text_len * gen_text_len / speed))))
|
216 |
|
217 |
# Print the calculated duration
|
218 |
print(f"Duration: {duration} seconds")
|