We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 207de50 commit 663ecceCopy full SHA for 663ecce
1 file changed
youtube_auto_dub/core.py
@@ -19,6 +19,7 @@
19
from youtube_auto_dub.models import (
20
AUDIO_DEFAULT_AMBIENT_GAIN,
21
DEFAULT_TTS_ENGINE,
22
+ SR_TTS,
23
TEMP_DIR,
24
WHISPER_DEFAULT_MODEL,
25
SubtitleSegment,
@@ -196,9 +197,13 @@ async def run(args) -> None:
196
197
if use_tempo:
198
info_list = []
199
for seg in project.segments:
200
+ tts_dur = 0.0
201
+ if seg.tts_audio_path and seg.tts_audio_path.exists():
202
+ import soundfile as sf
203
+ tts_dur = len(sf.read(seg.tts_audio_path, dtype="float32")[0]) / SR_TTS
204
info_list.append({
205
"start": seg.start,
- "target_dur": seg.duration,
206
+ "target_dur": tts_dur,
207
"wav_path": seg.tts_audio_path,
208
})
209
0 commit comments