Python谷歌翻译库Gpyts

电脑技术 电脑技术 1039 人阅读 | 0 人回复 | 2022-04-05

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
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)
实现机器翻译和文字识别
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则