From 97fc79f51b10261e517d4f7f3a7723bb80cd6b87 Mon Sep 17 00:00:00 2001 From: sunbear99 <106839284+sunbear99@users.noreply.github.com> Date: Fri, 3 Jun 2022 13:36:48 -0600 Subject: [PATCH] Update voices.py Added Support For Reading Text in a post --- video_creation/voices.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video_creation/voices.py b/video_creation/voices.py index e8d8e43..43fb7fc 100644 --- a/video_creation/voices.py +++ b/video_creation/voices.py @@ -20,6 +20,10 @@ def save_text_to_mp3(reddit_obj): tts = gTTS(text=reddit_obj["thread_title"], lang="en", slow=False) tts.save(f"assets/mp3/title.mp3") length += MP3(f"assets/mp3/title.mp3").info.length + tts = gTTS(text=reddit_obj["thread_selftext"], lang="en", slow=False) + tts.save(f"assets/mp3/selftext.mp3") + length += MP3(f"assets/mp3/selftext.mp3").info.length + for idx, comment in track(enumerate(reddit_obj["comments"]), "Saving..."): # ! Stop creating mp3 files if the length is greater than 50 seconds. This can be longer, but this is just a good starting point