简体   繁体   中英

Azure Text to Speech Error: 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND) when deploying to Azure App Services Linux environment

I adapted the quick start code Python version here for Azure text to speech.
The app runs correctly on my local server. However, when I deploy the app through Visual Studio Code to Azure App Services, I got the error: 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND) . I found that this error is the same as the posts here and here . The reason seems to be that the Python interpreter used was from Microsoft Store instead of from Python.org. The solution, therefore, seems to be switching from the Microsoft Store version of Python to the Python.org version of python.

However, the solution above seems only work for those apps that run on a local or remote server. Since I am deploying my app to Azure App Services, and the deployment builds everything remote using oryx , I don't know how to switch from Microsoft Store version Python to the Python.org version python remotely. I tried to change the Azure App Services Python version using Powershell, following the instruction from this post , but I was only able to change it from the current version of Python 3.9 to Python 3.8. When trying to change to version 3.10, I got an error message saying Python 3.10 is not supported.

After changing to Python 3.8, a new error was given:

ModuleNotFoundError at /
No module named '_speech_py_impl'

Thanks to @RajkumarMamidiChettu-MT for the instruction in the answer below. I think the solution is at the right direction. However, I got stuck at Step 3: My Azure app resource group is Linux (this seems to be default for Python apps and I can't change it). Therefore my kudu site does not have the UI of Debug Console and I cannot drag and drop my local Python package to the server. I do see that I have SSH and BASH interface. However, I don't know how and where to upload the package with either SSH or Bash. 我的 KUDU 网站截图 Hopefully, someone can point me to the right direction. I feel I am getting so close.

For what it's worth, I found the Azure Text to Speech Error: 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND) error in my situation is because the deployment process was looking for the Linux version of Azure-Congnitiveservices-speech library, which ends with .so . However, for whatever reason, those .so library files were not generated when deploying my app to the Azure Linux environment. And the method mentioned in another post Azure Speech to text 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND) of manually pasting .dll (library files in windows) files to the execution path didn't work, because the web app environment is Linux, which is the default environment by Azure App Services for the Python web app. And there is no way to change the web app environment from Linux to Windows if using Azure's preconfigured web app environment to deploy a python app.

I was not able to figure out how to generate .so files for the Azure-Congnitiveservices-Speech pack with the default Linux environment. So I end up creating a custom Docker Windows Server container with Python 3.10, WindowsServer2019 ( python:3.10.4-windowsservercore-1809 2022 is not supported at the time of this post), and then deploying it to Azure App Services with the customer docker container. It is working now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM