fix: tts blending sentences from diff. paragraphs

pull/1483/head
Poogee 2 years ago
parent 4c01a1d83f
commit aacd63116d

@ -51,11 +51,18 @@ class TTSEngine:
self.length = 0 self.length = 0
self.last_clip_length = last_clip_length self.last_clip_length = last_clip_length
def add_periods(self): # adds periods to the end of paragraphs (where people often forget to put them) so tts doesn't blend sentences
for comment in self.reddit_object["comments"]:
comment["comment_body"] = comment["comment_body"].replace('\n', '. ')
if comment["comment_body"][-1] != '.':
comment["comment_body"] += '.'
def run(self) -> Tuple[int, int]: def run(self) -> Tuple[int, int]:
Path(self.path).mkdir(parents=True, exist_ok=True) Path(self.path).mkdir(parents=True, exist_ok=True)
print_step("Saving Text to MP3 files...") print_step("Saving Text to MP3 files...")
self.add_periods()
self.call_tts("title", process_text(self.reddit_object["thread_title"])) self.call_tts("title", process_text(self.reddit_object["thread_title"]))
# processed_text = ##self.reddit_object["thread_post"] != "" # processed_text = ##self.reddit_object["thread_post"] != ""
idx = None idx = None

Loading…
Cancel
Save