【问题标题】:Azure Speech to text 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND)Azure 语音转文本 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND)
【发布时间】:2022-11-14 09:52:42
【问题描述】:

我一直在尝试启动一个涉及 azure Speech to text 的项目,出于测试目的,我想用这个站点中的演示代码来证实它的工作原理:

https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started-speech-to-text?tabs=windowsinstall%2Cterminal&pivots=programming-language-python

已将 Microsoft 可再发行组件中的所有先决条件安装到 pip install azure-cognitiveservices-speech

我已经设置了我的默认麦克风。

通过 azure 门户 > 所有资源 > 语音资源 > 密钥和端点从 azure 认知服务获取我的订阅密钥和区域

但我无法启动演示,因为它抛出错误0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND)

追溯是

Traceback (most recent call last):
  File "c:\Users\user\Desktop\Azure test\test.py", line 26, in <module>
    recognize_from_microphone()
  File "c:\Users\user\Desktop\Azure test\test.py", line 10, in recognize_from_microphone
    speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config)
  File "C:\Users\user\Desktop\Azure test\.env\lib\site-packages\azure\cognitiveservices\speech\speech.py", line 808, in __init__
    self._impl = self._get_impl(impl.SpeechRecognizer, speech_config, audio_config, language, source_language_config, auto_detect_source_language_config)
  File "C:\Users\user\Desktop\Azure test\.env\lib\site-packages\azure\cognitiveservices\speech\speech.py", line 870, in _get_impl
    return reco_type._from_config(speech_config._impl)
RuntimeError: Exception with an error code: 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND)

调用堆栈如下

[CALL STACK BEGIN]
    > pal_string_to_wstring
    - pal_string_to_wstring
    - audio_config_get_audio_processing_options
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
    - pal_string_to_wstring
[CALL STACK END]

以防万一我使用的是从微软商店获得的 Windows 11 和 Python 3.9.12。

我会发布代码,但它是在 html 中找到的代码的文字副本,仅带有在所述位置找到的订阅密钥。

编辑:

我能够使用 javascript 运行相同的示例,但 node.js 仅支持从音频文件到文本,这不是我想要的。

天蓝色的文本语音也可以使用 js 与麦克风一起使用,但使用浏览器意味着客户端,但最好这不是我想要的。只是指出这一点作为证明所有来自 azure 的资源都已正确配置,也许这​​与 python 或 pip 包管理器有关,但就像我说的其他主题中提到的所有 dll 文件都在虚拟环境中,所以它“不应该”是一个问题

如果有人可以帮助我,因为我在这里不知所措。

【问题讨论】:

    标签: python azure speech-to-text


    【解决方案1】:

    请检查我的发现是否有帮助:

    正如您提到的,您正在使用蟒蛇 3.9.12获得自微软商店.

    同样的问题已在 GitHub 中注册,人们通过以下方式解决了此问题从 Python.org 网站切换/使用 Python 解释器并将 azure 站点包复制到该安装位置。

    所以,尝试切换到蟒蛇解释器来自官方网站和此GitHub issue 中给出的故障排除步骤。

    【讨论】:

    • 感谢您的评论。我修改了示例代码,它在我的本地服务器上正确运行。但是,当我通过 Visual Studio Code 将应用程序部署到 Azure 应用程序服务时,我得到了同样的错误:0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND)。由于部署根据我对 Azure 的理解构建了所有远程,我不知道如何从 Microsoft Store 版本 Python 切换到 Python.org 版本 python。有人可以帮忙吗?
    【解决方案2】:

    根据定义的pre-requisites,确保安装了依赖项。

    就我而言,我需要libssl-dev libasound2

    【讨论】:

      猜你喜欢
      • 2021-08-20
      • 1970-01-01
      • 2019-01-06
      • 1970-01-01
      • 2021-09-06
      • 1970-01-01
      • 2023-01-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多