added crunch for sync tiktok tts

pull/963/head
Drugsosos 2 years ago
parent 01b932bf88
commit 3498ffdf09
No known key found for this signature in database
GPG Key ID: 8E35176FE617E28D

@ -94,6 +94,7 @@ class TikTok: # TikTok Text-to-Speech Wrapper
vstr = [r.json()["data"]["v_str"]][0] vstr = [r.json()["data"]["v_str"]][0]
b64d = base64.b64decode(vstr) b64d = base64.b64decode(vstr)
with open(filepath, "wb") as out: with open(filepath, "wb") as out:
out.write(b64d) out.write(b64d)

@ -84,9 +84,9 @@ class TTSEngine:
) )
clip_length = audio_length(f'assets/temp/mp3/{filename}.mp3') clip_length = audio_length(f'assets/temp/mp3/{filename}.mp3')
print(clip_length, '/', self.__total_length) print(clip_length, '/', self.__total_length) # TODO remove debug
if self.__total_length + clip_length <= self.max_length: if clip_length and self.__total_length + clip_length <= self.max_length:
self.__total_length += clip_length self.__total_length += clip_length
return True return True
return False return False

@ -1 +1,10 @@
[] [
{
"subreddit": "AskReddit",
"id": "vwgslz",
"time": "1657565829",
"background_credit": "bbswitzer",
"reddit_title": "Which singer should never have been famous",
"filename": "Which singer should never have been famous.mp4"
}
]

@ -28,6 +28,7 @@ from video_creation.background import download_background, chop_background_video
console = Console() console = Console()
W, H = 1080, 1920 # TODO move to config W, H = 1080, 1920 # TODO move to config
max_length: int = 50 # TODO move to config max_length: int = 50 # TODO move to config

Loading…
Cancel
Save