我正在创建一个使用 Azure 认知服务的语音方面的程序。当我仅使用控制台打印来部署可执行文件(.exe)时,它会按预期工作。该程序在 VS Code 环境中与 Azure Voice 完美配合,但一旦将其部署为可执行文件 (.exe),就会完全出错,并显示以下错误:
RuntimeError: Exception with an error code: 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND)
[CALL STACK BEGIN]
> property_bag_copy
- synthesizer_create_speech_synthesizer_from_config
- synthesizer_create_speech_synthesizer_from_config
- 00007FFECED052D4 (SymFromAddr() error: Attempt to access invalid address.)
- 00007FFECED4DA6E (SymFromAddr() error: Attempt to access invalid address.)
- 00007FFECED4E0F3 (SymFromAddr() error: Attempt to access invalid address.)
- PyArg_ParseTuple_SizeT
- PyEval_EvalFrameDefault
- PyFunction_Vectorcall
- PyEval_EvalFrameDefault
- PyObject_GC_Del
- PyFunction_Vectorcall
- PyType_GenericNew
- PyType_GenericNew
- PyObject_MakeTpCall
- PyEval_EvalFrameDefault
[CALL STACK END]
我尝试重新安装所有依赖项
最佳答案
错误表明无法找到音频sys库/
如果无法访问依赖项 dll,则可能会出现此错误:
Microsoft.CognitiveServices.Speech.extension.audio.sys.dll
您可以先将此 dll 添加到您的包中,然后再将其转换为 exe。
该文件将位于您安装 python 语音模块的位置。
关于python - Azure 认知服务和 Python 可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68550558/