I have been working my way through the Python handbook. I recently created a text to speech program in Python. All the code works well when using Google gTTS to read English sentences. But, when I try to change the language to Chinese (zh-CN) my code does not work at all. What am I doing wrong? My code is below. I submitted the following Pinyin Chinese text into my code below:
“Wǒ yào”
Here is my code:
#import Google's text to speech into your program
from gtts import gTTS
#grab data from user and store it in a variable
mt = input("Please enter the information you would like me to read: \t")
#Choose your recording language and store it in a variable
language = 'zh-CN'
#Transfer the recording into text to speech and save it in a variable
voice = gTTS(text=mt, lang=language, slow=False)
#save the recording which was in above variable and put it in a mp3 file
voice.save("conv.mp3")