Azure OpenAI Speech to Speech chat on Raspberry Pi

Sashank Neelamraju 0 Reputation points
2024-08-10T11:29:04.02+00:00

I am trying to run the Azure OpenAI speech to speech chat example on my Raspberry Pi with 64 bit OS and connected a USB microphone and speaker to it. I installed all the required libraries successfully. However, I am facing some issues. When I run the python code, i get the following error:

Traceback (most recent call last): File "/home/admin/Voice_Assistant/voice_assistant.py", line 27, in <module> speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_output_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/admin/Voice_Assistant/myenv/lib/python3.11/site-packages/azure/cognitiveservices/speech/speech.py", line 2225, in __init__ _call_hr_fn(fn=_sdk_lib.synthesizer_create_speech_synthesizer_from_config, *[ File "/home/admin/Voice_Assistant/myenv/lib/python3.11/site-packages/azure/cognitiveservices/speech/interop.py", line 62, in _call_hr_fn _raise_if_failed(hr) File "/home/admin/Voice_Assistant/myenv/lib/python3.11/site-packages/azure/cognitiveservices/speech/interop.py", line 55, in _raise_if_failed __try_get_error(_spx_handle(hr)) File "/home/admin/Voice_Assistant/myenv/lib/python3.11/site-packages/azure/cognitiveservices/speech/interop.py", line 50, in __try_get_error raise RuntimeError(message) RuntimeError: Exception with error code: [CALL STACK BEGIN] /home/admin/Voice_Assistant/myenv/lib/python3.11/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(+0x850ac) [0x7fb4d850ac] /home/admin/Voice_Assistant/myenv/lib/python3.11/site-packages/azure/cognitiveservices/speech/libMicrosoft.CognitiveServices.Speech.core.so(synthesizer_create_speech_synthesizer_from_config+0x224) [0x7fb4ecdf30] /lib/aarch64-linux-gnu/libffi.so.8(+0x63e0) [0x7fb54563e0] /lib/aarch64-linux-gnu/libffi.so.8(+0x5b24) [0x7fb5455b24] /usr/lib/python3.11/lib-dynload/_ctypes.cpython-311-aarch64-linux-gnu.so(+0x12094) [0x7fb54a2094] /usr/lib/python3.11/lib-dynload/_ctypes.cpython-311-aarch64-linux-gnu.so(+0x1048c) [0x7fb54a048c] python3(PyObject_Call+0x214) [0x4f35f8] python3(_PyEval_EvalFrameDefault+0x4844) [0x4ae2f4] python3(_PyFunction_Vectorcall+0x19c) [0x4e2bcc] python3(PyObject_Call+0xac) [0x4f3490] python3(_PyEval_EvalFrameDefault+0x4844) [0x4ae2f4] python3(_PyFunction_Vectorcall+0x19c) [0x4e2bcc] python3(_PyObject_FastCallDictTstate+0x2e8) [0x49c2f8] python3() [0x4edd44] python3(_PyObject_MakeTpCall+0x1d8) [0x494608] python3(_PyEval_EvalFrameDefault+0x8ec) [0x4aa39c] python3(PyEval_EvalCode+0xb0) [0x4a0c70] python3() [0x5fd9a8] [CALL STACK END] Failed to get HTTP platform singleton instance. Error: 27

Could someone help me out in troubleshooting this error? What needs to be changed?

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
2,061 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,080 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,598 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 27,540 Reputation points Microsoft Employee Moderator
    2024-08-13T03:45:09.4433333+00:00

    @Sashank N Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    .

    Please follow the below action plan:

    • Ensure your Raspberry Pi has a stable internet connection and no firewall or network policies are blocking the connection to the Azure service.
    • Make sure you are using a supported version of Python and the latest version of the Azure Speech SDK.
    • Ensure all necessary dependencies are installed on your Raspberry Pi. You might need to install additional libraries like libssl-dev and ca-certificates.
    • Also please enable the Speech SDK logging to get a verbose error log to identify the cause of the issue.
    • Try adding speech_config.set_property_by_name("OPENSSL_DISABLE_CRL_CHECK", "true") in your code and check. Though it is not recommended. But it will help in isolating the issue.

    .

    Suggestions:

    • Please be aware that the Speech Devices SDK is now retired.
    • The SDK has issues reported on Raspberrian Pi OS in the past. I have seen issues on the SDK issues pages.
    • You can however install the supported libraries for windows or linux OS. For example: With the SDK version 1.11.0 binaries for linux ARM32 and ARM64 are released for raspberry pi. You could also try with 1.16.0 SDK version and check. .
    • Also, the SDK issues pages here and here are the official support page for issues related to the SDK. I hope this helps.

    .

    I hope this helps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.