SPXERR_GSTREAMER_NOT_FOUND_ERROR, Python, Windows 11 - python

I'm having an issue with running azure-cognitiveservices-speech python SDK which uses GStreamer. I followed the instruction Quickstart: Create captions with speech to text and got the following error:
File "C:\Users\z\Desktop\cognitive-services-speech-sdk-master\scenarios\python\console\captioning\captioning.py", line 355, in <module>
speech_recognizer_data = captioning.speech_recognizer_from_user_config()
File "C:\Users\z\Desktop\cognitive-services-speech-sdk-master\scenarios\python\console\captioning\captioning.py", line 263, in speech_recognizer_from_user_config
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_config_data["audio_config"])
File "C:\Users\z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\azure\cognitiveservices\speech\speech.py", line 1004, in __init__
_call_hr_fn(
- recognizer_create_speech_recognizer_from_config - ffi_prep_go_closure
- ffi_call_go
- ffi_call - 00007FFB60E62C35 (SymFromAddr() error: Attempt to access invalid address.)
- 00007FFB60E629B7 (SymFromAddr() error: Attempt to access invalid address.)
- 00007FFB60E62628 (SymFromAddr() error: Attempt to access invalid address.) - PyObject_Call
- PyEval_EvalFrameDefault
- PyFunction_Vectorcall
[CALL STACK END]
Exception with an error code: 0x29 (SPXERR_GSTREAMER_NOT_FOUND_ERROR)
When running gst-inspect-1.0.exe --version I can see that GStreamer is available:
gst-inspect-1.0 version 1.18.3
GStreamer 1.18.3
Unknown package origin
I am using azure-cognitiveservices-speech 1.25.0, Windows 11, Python 3.10.
I was trying to use older and latest version of SDK but I'm still getting the same error.

Related

OpenCv error in function Circle. Works on python 3.9 but dont work on python 3.8

Hi i trying to run some python program for image analyse.
I got configured environment on python 3.9 and there its works fine with anaconda, but now i need to run it on python 3.8 becouse i have to integrate this Py with Python.NET.
After running my program at 3.8 i got these error :
OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'circle'
> Overload resolution failed:
> - Can't parse 'center'. Sequence item with index 0 has a wrong type
> - Can't parse 'center'. Sequence item with index 0 has a wrong type
File "plot_new.py", line 221, in plotThick
cv2.circle(im_with_pairs,tuple(point),10,magenta, thickness = 2)
File "abc.py", line 212, in Analytics
preferences = plot_new.plotThick(preferences, images, Ac, Ao, every_path, h, v)
File "abc.py", line 307, in <module>
I dont know python, how can i know what going wrong ?
On the same pc, it works spyder with anacodna and python 3.9.
But these error showed on installed by me environment python 3.8.

Azure Speech to text 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND)

I've been trying to start a project involving azure speech to text and for testing purpose wanted to corroborate the workings with the demo code found in this site:
https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started-speech-to-text?tabs=windowsinstall%2Cterminal&pivots=programming-language-python.
Installed all the prerequisites from Microsoft redistributables to pip install azure-cognitiveservices-speech.
I've set my default microphone.
Got my subscription key and region from azure cognitive service via azure portal> all resources> speech resource> keys and endpoint
But im unable to start the demo since it throws error 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND)
The traceback is
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)
The call stack goes as follow
[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]
Just in case it matter I'm using Windows 11 and Python 3.9.12 acquired from microsoft store.
I would post the code but it's a literal copy of the one found in the html only with the subscription key which found in said place.
Edit:
I was able to run the same example using javascript but node.js only supports from audio file to text which is not what I'm looking for.
Also azure speech to text does work with microphone using js but using the browser with means client side but optimally this isn't what I'm looking for. Just pointing this out as proof all resource from azure are configured correctly and maybe this is something related to python or pip package manager but like i said all the dll files mentioned in other topics are in the virtual environment so it "shouldn't" be an issue
If someone could help me since I'm at loss here.
Please check if my findings are helpful:
As you mentioned that you are using the Python 3.9.12 acquired from Microsoft store.
The same issue had been registered in the GitHub where people had fixed this issue by switching/using the Python interpreter from the Python.org website and copied over the azure site packages to that install location.
So, try switching to python interpreter from official website and the troubleshooting steps given in this GitHub issue.
Per the defined pre-requisites, make sure to have dependencies installed.
In my case, I needed libssl-dev libasound2.

Azure Cognitive Services and Python Executable

I am working on creating a program that uses the Speech aspect of Azure's Cognitive Services. When I deploy the executable(.exe) with just console printing, it works as hoped. The program works perfect with the Azure Voice within the VS Code environment, but once it is deployed as an executable (.exe), it completely errors out with the following error:
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]
I have tried reinstalling all dependencies
The error indicates that it is not able to find the audio sys library/
This error might arise if it is not able to access the dependency dll :
Microsoft.CognitiveServices.Speech.extension.audio.sys.dll
You could add this dll to your package before converting it to exe.
The file will be in present at the location where you had installed the Speech Module for python.

poetry [EnvCommandError] Fatal Python error: Py_Initialize: can't initialize sys standard streams

I have a pyproject.toml file that was created using poetry, and I'm trying to run the command poetry install in this directory to create a poetry.lock file. However, when I run poetry install, I get the following error:
EnvCommandError
Command C:\Users\myName\AppData\Local\pypoetry\Cache\virtualenvs\my-app-name-kS94etse-py3.8\Scripts\python.exe -
errored with the following return code 3, and output:
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
File "c:\users\myName\anaconda3\lib\io.py", line 52, in <module>
File "c:\users\myName\anaconda3\lib\abc.py", line 106
print(f"Class: {cls.__module__}.{cls.__qualname__}", file=file)
^
SyntaxError: invalid syntax
input was : import sys
This error seems pretty in depth but I dont understand why poetry thinks import sys is invalid syntax or even where that's being called to create an issue. Any suggestions on how to fix this?
Resolved here:
https://stackoverflow.com/a/67169273/12060361
Download a new, non-broken version of Python (the same version defined in your pyproject.toml file to use): https://www.python.org/downloads/release/python-385/
Navigate to the virtual env folder poetry says the error is coming from: C:\Users\myName\AppData\Local\pypoetry\Cache\virtualenvs\my-app-name-kS94etse-py3.8\Scripts\python.exe
Replace the python.exe currently in that folder with the new one you just downloaded

OSError: No Default Input Device Available (PyAudio)

I am using this Github repo to guide me in my process to create a Flask application that can detect your mood via your voice. To build the application I was on Windows 10 using Pycharm and Python 3.6. Everything works fine and I have no issues as you can see with this output: successful output.
My problems arise when I clone my app to my Ubuntu subsystem on my Windows machine or my Google VM running Ubuntu 18. When I try to record my voice I get this error: OSError: [Errno -9996] Invalid output device (no default output device) (full error here).
I have seen this Stackoverflow post get linked many times when encountering this error but none of the answers fixed my issue.
When I run this code
>>> import pyaudio
>>> pa = pyaudio.PyAudio()
>>> pa.get_default_input_device_info()
I get this ouput
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ian/app/env/lib/python3.6/site-packages/pyaudio.py", line 949, in get_default_input_device_info
device_index = pa.get_default_input_device()
OSError: No Default Input Device Available

Categories

Resources