You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importChatTTSimporttorchimporttorchaudiochat=ChatTTS.Chat()
chat.load(compile=False) # Set to True for better performancetexts= ["PUT YOUR 1st TEXT HERE", "PUT YOUR 2nd TEXT HERE"]
wavs=chat.infer(texts)
torchaudio.save("output1.wav", torch.from_numpy(wavs[0]), 24000)
应修正为
importChatTTSimporttorchimporttorchaudiochat=ChatTTS.Chat()
chat.load(compile=False) # Set to True for better performancetexts= ["PUT YOUR 1st TEXT HERE", "PUT YOUR 2nd TEXT HERE"]
wavs=chat.infer(texts)
foriinrange(len(wavs)):
""" 在某些版本的torchaudio里,第一行代码能运行,但在另一些版本中,则是第二行代码能运行。 """try:
torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]).unsqueeze(0), 24000)
except:
torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]), 24000)
The text was updated successfully, but these errors were encountered:
中文README.md中基础用法部分
应修正为
The text was updated successfully, but these errors were encountered: