7 lines
201 B
Python
7 lines
201 B
Python
from TTS.api import TTS
|
|
|
|
# 选择合适的预训练模型
|
|
model_name = TTS.list_models()[0]
|
|
tts = TTS(model_name)
|
|
text = "这是要合成的文本。"
|
|
tts.tts_to_file(text=text, file_path="output.wav") |