Это мой код
из gtts импортировать gTTS
def text_to_audio(текст, имя файла):
Код: Выделить всё
text_with_breaks = "\n".join(text.split(","))
text_with_breaks = text_with_breaks.replace(".", ".\n")
tts = gTTS(text=text_with_breaks, lang='en')
tts.save(filename)
filename = "greeting_audioo.mp3"
text_to_audio(text, имя файла)
Подробнее здесь: https://stackoverflow.com/questions/783 ... -in-python