chore: moved the VIDEO LENGTH var

pull/790/head
Jason 2 years ago
parent a5fe2eface
commit 03b533cca9

@ -9,7 +9,7 @@ from rich.progress import track
from moviepy.editor import AudioFileClip, CompositeAudioClip, concatenate_audioclips
from utils.console import print_step, print_substep
from utils.voice import sanitize_text
DEFUALT_MAX_LENGTH: int = 50
class TTSEngine:
@ -30,7 +30,7 @@ class TTSEngine:
tts_module,
reddit_object: dict,
path: str = "assets/temp/mp3",
max_length: int = 50,
max_length: int = DEFUALT_MAX_LENGTH,
):
self.tts_module = tts_module()
self.reddit_object = reddit_object

@ -22,11 +22,8 @@ TTSProviders = {
"TikTok": TikTok,
}
VIDEO_LENGTH: int = 40 # secs
def save_text_to_mp3(reddit_obj: dict[str]) -> tuple[int, int]:
"""Saves text to MP3 files. Goes through the reddit_obj and generates the title MP3 file and a certain number of comments until the total amount of time exceeds VIDEO_LENGTH seconds.
"""Saves text to MP3 files.
Args:
reddit_obj (dict[str]): Reddit object received from reddit API in reddit/subreddit.py
@ -41,7 +38,6 @@ def save_text_to_mp3(reddit_obj: dict[str]) -> tuple[int, int]:
get_case_insensitive_key_value(TTSProviders, env), reddit_obj
)
else:
choice = ""
while True:
print_step("Please choose one of the following TTS providers: ")
print_table(TTSProviders)

Loading…
Cancel
Save