diff --git a/TTS/engine_wrapper.py b/TTS/engine_wrapper.py index f040bf7..cdd024e 100644 --- a/TTS/engine_wrapper.py +++ b/TTS/engine_wrapper.py @@ -67,8 +67,6 @@ class TTSEngine: comment["comment_body"] = comment["comment_body"].replace(".. . ", ".") comment["comment_body"] = comment["comment_body"].replace(". . ", ".") comment["comment_body"] = re.sub(r'\."\.', '".', comment["comment_body"]) - print(comment["comment_body"]) - def run(self) -> Tuple[int, int]: Path(self.path).mkdir(parents=True, exist_ok=True) @@ -152,7 +150,7 @@ class TTSEngine: print("OSError") def call_tts(self, filename: str, text: str): - self.tts_module.run(text, filepath=f"{self.path}/{filename}.mp3") + self.tts_module.run(text, filepath=f"{self.path}/{filename}.mp3", random_voice=settings.config["settings"]["tts"]["random_voice"]) # try: # self.length += MP3(f"{self.path}/{filename}.mp3").info.length # except (MutagenError, HeaderNotFoundError): diff --git a/utils/.config.template.toml b/utils/.config.template.toml index a360569..a674f53 100644 --- a/utils/.config.template.toml +++ b/utils/.config.template.toml @@ -44,6 +44,7 @@ background_thumbnail_font_color = { optional = true, default = "255,255,255", ex [settings.tts] voice_choice = { optional = false, default = "streamlabspolly", options = ["streamlabspolly", "tiktok", "googletranslate", "awspolly", "pyttsx", ], example = "tiktok", explanation = "The voice platform used for TTS generation. This can be left blank and you will be prompted to choose at runtime." } +random_voice = { optional = false, default = true, example = true, options = [true, false,], explanation = "Randomizes the voice used for each comment" } aws_polly_voice = { optional = false, default = "Matthew", example = "Matthew", explanation = "The voice used for AWS Polly" } streamlabs_polly_voice = { optional = false, default = "Matthew", example = "Matthew", explanation = "The voice used for Streamlabs Polly" } tiktok_voice = { optional = true, default = "en_us_001", example = "en_us_006", explanation = "The voice used for TikTok TTS" } diff --git a/video_creation/final_video.py b/video_creation/final_video.py index ca801c5..0ff652a 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -103,6 +103,7 @@ def prepare_background(reddit_id: str, W: int, H: int) -> str: exit() return output_path + def merge_background_audio(audio: ffmpeg, reddit_id: str): """Gather an audio and merge with assets/backgrounds/background.mp3 Args: