only speed up, don't slow down

This commit is contained in:
rany
2022-03-10 15:49:20 +02:00
parent 843e6b4b38
commit 9da1a87f30

View File

@@ -46,6 +46,7 @@ def ensure_audio_length(in_file, out_file, length):
atempo = 0.5 atempo = 0.5
elif atempo > 100: elif atempo > 100:
atempo = 100 atempo = 100
if atempo > 1:
process = subprocess.call( process = subprocess.call(
[ [
"ffmpeg", "ffmpeg",
@@ -61,6 +62,8 @@ def ensure_audio_length(in_file, out_file, length):
) )
if process != 0: if process != 0:
raise Exception("ffmpeg failed") raise Exception("ffmpeg failed")
else:
shutil.copyfile(in_file, out_file)
async def _main(srt_data, voice_name, out_file): async def _main(srt_data, voice_name, out_file):