willsonlincake 发表于 2022-4-5 12:52:27

Python谷歌翻译库Gpyts

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)
实现机器翻译和文字识别
页: [1]
查看完整版本: Python谷歌翻译库Gpyts