added Max video lenght option in config file

pull/1480/head
electro199 3 years ago
parent 6af57bfd1d
commit ad5c814da4

@ -32,6 +32,7 @@ storymode_max_length = { optional = true, default = 1000, example = 1000, explan
fps = { optional = false, default = 30, example = 30, explanation = "Sets the FPS of the video, 30 is default for best performance. 60 FPS is smoother.", type = "int", nmin = 1, nmax = 60, oob_error = "The FPS HAS to be between 1 and 60" }
resolution_w = { optional = false, default = 1080, example = 1440, explantation = "Sets the width in pixels of the final video" }
resolution_h = { optional = false, default = 1920, example = 2560, explantation = "Sets the height in pixels of the final video" }
max_video_lenght = { optional = false, default = 50, example = 30, explantation = "Sets the max lenght of the final video in seconds" type = "int",nmin = 5 }
[settings.background]
background_choice = { optional = true, default = "minecraft", example = "rocket-league", options = ["minecraft", "gta", "rocket-league", "motor-gta", "csgo-surf", "cluster-truck", "minecraft-2","multiversus","fall-guys","steep", ""], explanation = "Sets the background for the video based on game name" }

@ -33,11 +33,7 @@ def save_text_to_mp3(reddit_obj) -> Tuple[int, int]:
"""
voice = settings.config["settings"]["tts"]["voice_choice"]
if str(voice).casefold() in map(lambda _: _.casefold(), TTSProviders):
text_to_mp3 = TTSEngine(
get_case_insensitive_key_value(TTSProviders, voice), reddit_obj
)
else:
if not str(voice).casefold() in map(lambda _: _.casefold(), TTSProviders):
while True:
print_step("Please choose one of the following TTS providers: ")
print_table(TTSProviders)
@ -45,8 +41,9 @@ def save_text_to_mp3(reddit_obj) -> Tuple[int, int]:
if choice.casefold() in map(lambda _: _.casefold(), TTSProviders):
break
print("Unknown Choice")
text_to_mp3 = TTSEngine(
get_case_insensitive_key_value(TTSProviders, choice), reddit_obj
get_case_insensitive_key_value(TTSProviders, choice), reddit_obj , max_length = settings.config["settings"]["len"]
)
return text_to_mp3.run()

Loading…
Cancel
Save