Update TTS.py

This commit is contained in:
YYuX-1145 2025-06-10 20:49:27 +08:00 committed by GitHub
parent 0d2f273402
commit f8d7f61ab9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1073,7 +1073,7 @@ class TTS:
###### setting reference audio and prompt text preprocessing ########
t0 = time.perf_counter()
if (ref_audio_path is not None) and (ref_audio_path != self.prompt_cache["ref_audio_path"]):
if (ref_audio_path is not None) and (ref_audio_path != self.prompt_cache["ref_audio_path"] or (self.is_v2pro and self.prompt_cache["refer_spec"][0][1] is None)):
if not os.path.exists(ref_audio_path):
raise ValueError(f"{ref_audio_path} not exists")
self.set_ref_audio(ref_audio_path)