Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -263,7 +263,9 @@ def infer_batch(ref_audio, ref_text, gen_text_batches, exp_name, remove_silence,
|
|
263 |
gen_text_len = calculate_weighted_length(gen_text)
|
264 |
|
265 |
# Duration calculation considering global speed factor
|
266 |
-
|
|
|
|
|
267 |
|
268 |
# Print the calculated duration
|
269 |
print(f"Chunk {i + 1}: Duration: {duration} speed {speed}")
|
|
|
263 |
gen_text_len = calculate_weighted_length(gen_text)
|
264 |
|
265 |
# Duration calculation considering global speed factor
|
266 |
+
# duration = int(ref_audio_len) + int(((ref_audio_len / ref_text_len) * gen_text_len) / speed)
|
267 |
+
|
268 |
+
duration = max(250, int(ref_audio_len) + int(((ref_audio_len / ref_text_len) * gen_text_len) / speed))
|
269 |
|
270 |
# Print the calculated duration
|
271 |
print(f"Chunk {i + 1}: Duration: {duration} speed {speed}")
|