From 05eedbb99275e5ffa9eb7f9c87b37b34c07dcbaa Mon Sep 17 00:00:00 2001 From: Tasha Upchurch Date: Sun, 20 Oct 2024 16:04:26 -0600 Subject: [PATCH] new xtts module and modified requirements.txt --- modules/xttscli.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/xttscli.py b/modules/xttscli.py index 45715da..02c14ee 100644 --- a/modules/xttscli.py +++ b/modules/xttscli.py @@ -12,7 +12,6 @@ from TTS.tts.models.xtts import Xtts XTTS_MODEL = None - def prepare_speaker_audio(speaker): """ Prepares the speaker audio file and returns the speaker file path. @@ -161,6 +160,9 @@ def main(): # Load the XTTS model load_model(args.checkpoint, args.config, args.vocab, args.device) + # Prepare to store generated files + all_output_files = [] + # Process multiple lines of text (if from file) if isinstance(args.text, list): for i, tts_text in enumerate(args.text): @@ -181,7 +183,8 @@ def main(): shutil.copy(output_path, output_file) os.remove(output_path) - print(f"TTS generation complete for line {i + 1}. Output saved to {output_file}") + all_output_files.append(output_file) + else: # Generate TTS for a single text input output_path = run_tts( @@ -201,7 +204,11 @@ def main(): shutil.copy(output_path, output_file) os.remove(output_path) - print(f"TTS generation complete. Output saved to {output_file}") + all_output_files.append(output_file) + + # Final output format to match expected behavior + main_output_file = all_output_files[0] + print(f"Generated files: ({main_output_file}, {all_output_files})") except Exception as e: logging.error("An error occurred: %s", traceback.format_exc()) @@ -209,6 +216,4 @@ def main(): if __name__ == '__main__': - # For testing - sys.argv = [sys.argv[0], '--test'] main()