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.
Related
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.
I want to use svn on my linux server(SUSE Linux Enterprise Server 11), and I install the svn 1.8.19, But when I use: svn update, problem shows up:
svn: E170000: Unrecognized URL scheme for 'http://.....'
These are infomation for svn:
svn, version 1.8.19 (r1800620)
compiled Aug 31 2017, 16:07:39 on x86_64-unknown-linux-gnu
Copyright (C) 2017 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/
The following repository access (RA) modules are available:
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
And then I find out that I need to install scons-2.5.1 and serf-1.3.9, but After I install the scons-2.5.1 , I got an error:
SCons import failed. Unable to find engine files in:
/usr/local/bin/../engine
/usr/local/bin/scons-local-2.5.1
/usr/local/bin/scons-local
/usr/local/lib/scons-2.5.1
/usr/lib/scons-2.5.1
/usr/local/lib/scons-2.5.1
/usr/local/lib/python2.6/site-packages/scons-2.5.1
/usr/lib/python2.6/site-packages/scons-2.5.1
/usr/local/lib/python2.6/site-packages/scons-2.5.1
/usr/lib64/scons-2.5.1
/usr/local/lib/scons
/usr/lib/scons
/usr/local/lib/scons
/usr/local/lib/python2.6/site-packages/scons
/usr/lib/python2.6/site-packages/scons
/usr/local/lib/python2.6/site-packages/scons
/usr/lib64/scons
Traceback (most recent call last):
File "/usr/local/bin/scons", line 190, in <module>
import SCons.Script
ImportError: No module named SCons.Script
Your svn client was not build with support for http and https. It is missing serf (libserf) library that adds http and https support.
Setup Details:
1x EC2 running Ubuntu 14.04 with Postgres 9.3,
1x RDS running Postgres 9.3
I am trying to move a postgres database that I have on an EC2 onto an RDS. I am using Londiste, which is recommended by AWS for migrating databases with minimal downtime. Specifically, I am using Londiste/Skytools 2.1.13, because Londiste3 requires superuser privileges on both systems.
I have tried installing Skytools both via the zip from their website and via apt-get (both 2.1.13). I have installed what I believe to be all of the dependencies: postgres,libpq-dev, postgresql-server-dev-9.3, pip, and psycopg2.
Regardless, whenever I try to use any skytools commands, I get the following error:
Traceback (most recent call last):
File "/usr/local/bin/pgqadm.py", line 9, in
from pgq.ticker import SmartTicker File "/usr/local/lib/python2.7/dist-packages/pgq/init.py", line 6, in
import pgq.consumer File "/usr/local/lib/python2.7/dist-packages/pgq/consumer.py", line 6,
in
from pgq.baseconsumer import BaseConsumer, BaseBatchWalker File "/usr/local/lib/python2.7/dist-packages/pgq/baseconsumer.py", line 75,
in
class BaseConsumer(skytools.DBScript): File "/usr/local/lib/python2.7/dist-packages/skytools/apipkg.py", line 114,
in __makeattr
result = importobj(modpath, attrname) File "/usr/local/lib/python2.7/dist-packages/skytools/apipkg.py", line 37,
in importobj
module = import(modpath, None, None, ['doc']) File "/usr/local/lib/python2.7/dist-packages/skytools/scripting.py", line
23,
in
default_skylog = skytools.installer_config.skylog
AttributeError: 'module' object has no attribute 'skylog'
Am I missing a dependency? (Skylog seems to be a part of skytools, so I've concluded it's not that.) Has anyone else hit this issue? (There don't seem to be any google results with this error.) Thanks!
tl;dr:
make sure you're running pgqadm.py that is in your local skytools-2.x.y installation directory, eg: ./python/pgqadm.py ticker.ini install
This can be a problem if you have previously installed Skytools 3.x, which may come up first in your PATH.
Background
I just ran into this same issue. I have the same use case (migrating pg->rds), and followed the same recommendation from the AWS documentation.
I had initially installed Skytools 3.x before noticing that it requires superuser privileges on the would-be replica. which pgqadm.py returns /usr/bin/pgqadm.py, which is an artifact of my abandoned Skytools 3.x installation.
I became suspicious of a version conflict when I went to the Skytools source repository looking for instances of skylog. The first result was here:
https://github.com/pgq/skytools-legacy/blob/11afc5210a92d4a2ccf701e4f92138488c31a3cb/python/skytools/installer_config.py.in
However, I realized that this repository is now tracking the latest 3.x release. I switched to the apparent 2.1.x branch, and skylog was nowhere to be found, as expected:
https://github.com/pgq/skytools-legacy/blob/skytools_2_1_stable/python/skytools/installer_config.py.in
Fully-qualifying the path to pgqadm.py resolves this issue in this case.
After upgrading my GAE Python Linux SDK from version 1.9.35 to 1.9.38 my application stopped working, all requests are failing in similar manner:
ERROR 2016-06-10 17:55:06,100 wsgi.py:263]
Traceback (most recent call last):
File "/usr/local/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/usr/local/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/usr/local/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/home/dancorn/src/apartsw/main/main.py", line 9, in <module>
import webapp2
ImportError: No module named webapp2
INFO 2016-06-10 17:55:06,102 module.py:788] default: "GET / HTTP/1.1" 500 -
I first thought that I somehow screwed up my PyCharm config, but simply rolling back to 1.9.35 (by pointing my /usr/local/google_appengine symlink back to the respective SDK version dir) got things back working as expected.
The SDK release notes don't appear to indicate anything related.
I found a similar report, but the suggested fix (rolling back) is not really acceptable down the road.
I also found this post, but I don't have protobuf (explicitly) installed: How to solve a webapp2 import error after upgrading Google App Engine launcher?. Still chewing on the related posts which led me to this potentially related delta in the SDK, which I'll investigate next:
diff google_appengine_1.9.35/_python_runtime.py google_appengine_1.9.38/_python_runtime.py
71a72,75
> if 'google' in sys.modules:
> google_path = os.path.join(os.path.dirname(__file__), 'google')
> google_module = sys.modules['google']
> google_module.__path__.append(google_path)
74,77c78
<
<
< if 'google' in sys.modules:
< del sys.modules['google']
---
> google_module.__file__ = google_path
Any other investigation leads?
Update: The issue was fixed in SDK version 1.9.40.
The issue is already known to Google, introduced in 1.9.37:
the acknowledged report with more info
tracked as GAE Issue 12963.
From the report thread, as per Jon Parrot:
Thanks everyone for reporting this. We've reproduced the issue and and
fix is incoming. It won't be in the next SDK release (38), but likely
will be in 39 or 40.
Until the fix is released an earlier unaffected SDK version (like 1.9.36) can be found here.
First, a disclaimer that I am new to Python (I come from Ruby). I'm trying to integrate Google Contacts API into my Heroku Python app. Seem to having a hard time figuring out how to push the gdata package (https://code.google.com/p/gdata-python-client/) to Heroku. This is the Heroku error msg:
Traceback (most recent call last):
2014-07-03T09:03:58.205264+00:00 app[web.1]: File "message.py", line 16, in <module>
2014-07-03T09:03:58.205327+00:00 app[web.1]: import atom.data
2014-07-03T09:03:58.205364+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/atom/data.py", line 24, in <module>
2014-07-03T09:03:58.205429+00:00 app[web.1]: import atom.core
2014-07-03T09:03:58.205516+00:00 app[web.1]: ImportError: No module named core
2014-07-03T09:03:59.454062+00:00 heroku[web.1]: State changed from starting to crashed
My first thought was to include gdata and atom in my requirements.txt (it looks like gdata depends on atom)
I tried adding this to my requirements.txt: gdata==2.0.18 atom==0.3.7. However I don't think I'm going about this the right away. The gdata-python-client I downloaded came with a setup.py file that I think I'm supposed to use when pushing to heroku, but I can't seem to get to work either (always get the same error above).
Help is much appreciated :)
I seemed to have gotten around it, but the only way I could fix this error was by removing gdata from requirements.txt and including the /build and /atom folder from https://code.google.com/p/gdata-python-client/ in my root directory.