From 485cb85a552c5bd5b6387569da9b1727332e940e Mon Sep 17 00:00:00 2001 From: Jacky He Date: Tue, 12 Aug 2025 14:03:15 +0800 Subject: [PATCH] fix: determine whether the filename was input or only path is input --- GPT_SoVITS/inference_cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GPT_SoVITS/inference_cli.py b/GPT_SoVITS/inference_cli.py index 795600ae..bfd4ec13 100644 --- a/GPT_SoVITS/inference_cli.py +++ b/GPT_SoVITS/inference_cli.py @@ -47,7 +47,10 @@ def synthesize(args: argparse.Namespace): if result_list: os.makedirs(args.output_path, exist_ok=True) # Create output directory if it doesn't exist - output_wav_path = os.path.join(args.output_path, "output.wav") + if args.output_path.endswith(".wav"): + output_wav_path = args.output_path + else: + output_wav_path = os.path.join(args.output_path, "output.wav") last_sampling_rate, last_audio_data = result_list[-1] sf.write(output_wav_path, last_audio_data, last_sampling_rate) print(f"Audio saved to {output_wav_path}")