【问题标题】:Voice translator in pythonpython中的语音翻译器
【发布时间】:2020-10-09 17:13:25
【问题描述】:

我已使用此代码-https://github.com/Alekh-sinha/google_translator/blob/master/text_to_speech_3.py 进行语音翻译。它基本上将语音转换为文本,然后翻译该文本,然后将翻译后的文本转换回语音。我想将它用于在我的 PC 上运行的视频,所以我在我的 PC 中启用了立体声混音并且它有效。但是当我将相同的主体应用于Skype通话时,它不起作用。 我将非常感谢有人会在这方面帮助我

【问题讨论】:

标签: python google-cloud-platform speech-recognition speech


【解决方案1】:

我已经尝试过了,但由于 Python 版本不同,它无法工作。所以最好做一个没有 API 的翻译器,它的代码在这里,但首先去你的终端并输入 pip install googletrans:

from googletrans import Translator

while True:
        sentence=str(input("say..."))
        translator=Translator()
        translated_sentence=translator.translate(sentence,src='en',dest='hi')
        print(translated_sentence.text)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-06
    相关资源
    最近更新 更多