pip install Gpyts
from gpyts.asyncGpyts import Gpyts
gpyts = Gpyts()
# Using full translation api. Returns all supported parameters listed.
translation = await gpyts.translate("hey, how are you?", to_lang = 'fr')
print("Text is : " + translation.text)
# Convert Text to Speech.
speech = await gpyts.tts("Fine, What about you?", lang = 'fr', slow = True, download = 'tts.mp3')
print("Saved as :" + speech.file)
实现机器翻译和文字识别