Smart_Talker/speek.py

7 lines
201 B
Python
Raw Permalink Normal View History

2025-04-17 14:21:53 +08:00
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")