📜  如何在 python 代码示例中将文本转为语音

📅  最后修改于: 2022-03-11 14:45:46.604000             🧑  作者: Mango

代码示例2
pip install pyttsx3
import pyttsx3 # you have to import py for python tts means text to speech and 3 for version 3 

speaker = pyttsx3.init() # congrats you have initialized a text to speech object
speaker.say('The text you want') # he will not say the word he will just store the word he have to say'
speaker.runAndWait() # this means he have to speak the text which he have stored previously