qqwjq1981 commited on
Commit
31a2d98
·
verified ·
1 Parent(s): 8e10d87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -473,13 +473,14 @@ def generate_voiceover_clone(translated_json, desired_duration, target_language,
473
  logger.info(f"⏱️ Target Duration: {desired_duration:.2f}s")
474
 
475
  # 4. Call TTS to generate audio
 
476
  tts.tts_to_file(
477
  text=full_text,
478
  speaker_wav=speaker_wav_path,
479
  language=target_language,
480
- file_path=output_audio_path
481
  # Uncomment if your model supports speed:
482
- # speed=speed_tts
483
  )
484
 
485
  # 5. Confirm file was written
 
473
  logger.info(f"⏱️ Target Duration: {desired_duration:.2f}s")
474
 
475
  # 4. Call TTS to generate audio
476
+ speed_tts = calculate_speed(full_text, desired_duration)
477
  tts.tts_to_file(
478
  text=full_text,
479
  speaker_wav=speaker_wav_path,
480
  language=target_language,
481
+ file_path=output_audio_path,
482
  # Uncomment if your model supports speed:
483
+ speed=speed_tts
484
  )
485
 
486
  # 5. Confirm file was written