mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-04-26 19:46:37 +08:00
增加健壮性: GPT_SoVITS/TTS_infer_pack/TTS.py
This commit is contained in:
parent
61453b59b2
commit
c85b29f5a8
@ -554,8 +554,12 @@ class TTS:
|
|||||||
|
|
||||||
audio = np.concatenate(audio, 0)
|
audio = np.concatenate(audio, 0)
|
||||||
audio = (audio * 32768).astype(np.int16)
|
audio = (audio * 32768).astype(np.int16)
|
||||||
|
|
||||||
|
try:
|
||||||
if speed_factor != 1.0:
|
if speed_factor != 1.0:
|
||||||
audio = speed_change(audio, speed=speed_factor, sr=int(self.configs.sampling_rate))
|
audio = speed_change(audio, speed=speed_factor, sr=int(self.configs.sampling_rate))
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Failed to change speed of audio: \n{e}")
|
||||||
|
|
||||||
yield self.configs.sampling_rate, audio
|
yield self.configs.sampling_rate, audio
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user