【问题标题】:Translate in python using Azure speech, directly from stream直接从流中使用 Azure 语音在 python 中翻译
【发布时间】:2020-12-10 17:04:19
【问题描述】:

我正在寻找语音 sdk 和一些示例中的功能,它可以让我从 Azure 语音中翻译来自麦克风以外的其他来源的实时流。 到目前为止,我找到了两个不完全符合我需求的解决方案

这个,翻译直播,但似乎使用默认麦克风。

https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started-speech-translation?tabs=script%2Cwindowsinstall&pivots=programming-language-python

我也找到了这个解决方案,使用speech_recognition_with_push_stream().,女巫很接近,但似乎没有翻译。只有语音到文本: Azure Speech SDK Speech to text from stream using python

感谢您的帮助!

【问题讨论】:

    标签: python azure speech-recognition translate azure-speech


    【解决方案1】:

    示例函数:official doc 第 113 行中的translation_continuous() 可能有助于您执行连续翻译工作。recognizer 将打开一个会话来处理来自源的流。

    【讨论】:

    • 很好,谢谢!唯一的问题是 translate_continuous() 示例使用文件。但似乎可以用流替换文件名。像这样:stream = speechsdk.audio.PushAudioInputStream()audio_config = speechsdk.audio.AudioConfig(stream=stream) 我没有任何错误,但是我写了流并且没有收到任何答案。但这可能是另一个问题
    • @Maxime,如果我的回答有帮助,请您点击答案旁边的复选标记以将其从灰色切换为填写以接受它,以便帮助其他人并关闭此查询:) 如果您还有其他问题,请发布另一个问题并让我知道链接,我会尽快为您提供帮助
    • 谢谢@Stanley,正如你所建议的,我已经为我的问题打开了一个新线程,任何建议都将不胜感激! stackoverflow.com/questions/65586642/…
    猜你喜欢
    • 2022-09-26
    • 1970-01-01
    • 2020-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-06
    • 1970-01-01
    相关资源
    最近更新 更多