Gregniuki commited on
Commit
db4f531
·
verified ·
1 Parent(s): 2d3a8ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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
- duration = int(ref_audio_len) + int(((ref_audio_len / ref_text_len) * gen_text_len) / speed)
 
 
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}")