fix: 就输入一个句号时,参考音频泄露进音频。

This commit is contained in:
CyberWon 2024-06-08 11:04:52 +08:00 committed by GitHub
parent 347dcd7d76
commit ede700d911
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -752,6 +752,10 @@ class TTS:
max_len = item["max_len"]
print(i18n("前端处理后的文本(每句):"), norm_text)
if norm_text[0] == ".":
yield self.configs.sampling_rate, np.zeros(int(self.configs.sampling_rate),
dtype=np.int16)
return
if no_prompt_text :
prompt = None
else:
@ -935,4 +939,4 @@ def speed_change(input_audio:np.ndarray, speed:float, sr:int):
# 将管道输出解码为 NumPy 数组
processed_audio = np.frombuffer(out, np.int16)
return processed_audio
return processed_audio