I tried espeak but didn't succeed and some functionalities only supported in python 2.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Have you tried using gTTS?
The syntax for using it in Python 3.x is as follows:
from gtts import gTTS
my_tts = "Text you want to process"
tts = gTTS(text=my_tts, lang='en')
tts.save("Absolute/path/to/file.mp3")
Here is the github repo of gTTS.
回答2:
For offline use: Direct use SAPI [Windows]
Following code will help for demo...
import win32com.client
speaker = win32com.client.Dispatch("SAPI.SpVoice")
speaker.Speak("Jumpman Jumpman Jumpman Them boys up to something!")