vosk-api
vosk-api copied to clipboard
cannot importing libvosk.dll
I can't load the vosk model and it doesn't give me an error. I did some editing to find the error.
def open_dll():
try:
dlldir = os.path.abspath(os.path.dirname(__file__))
if sys.platform == "win32":
# We want to load dependencies too
print("importing vosk dll...1")
os.environ["PATH"] = dlldir + os.pathsep + os.environ["PATH"]
print("importing vosk dll...2")
if hasattr(os, "add_dll_directory"):
print("importing vosk dll...3")
os.add_dll_directory(dlldir)
print("importing vosk dll...4")
print(os.path.join(dlldir, "libvosk.dll"))
e=_ffi.dlopen(os.path.join(dlldir, "libvosk.dll"))
print("importing vosk dll...5")
return e
elif sys.platform == "linux":
return _ffi.dlopen(os.path.join(dlldir, "libvosk.so"))
elif sys.platform == "darwin":
return _ffi.dlopen(os.path.join(dlldir, "libvosk.dyld"))
else:
raise TypeError("Unsupported platform")
except Exception as e:
print(f"An error occurred: {e}")
the output is like this
importing vosk dll...1
importing vosk dll...2
importing vosk dll...3
importing vosk dll...4
C:\Users\dcyilmaz\AppData\Local\Programs\Python\Python312\Lib\site-packages\vosk\libvosk.dll
When I check the dll file, it exists in the directory
You can check with dependencywalker to see what is missing for the dll.
You can check with dependencywalker to see what is missing for the dll.
When I try to open libvosk.dll with the library https://github.com/lucasg/Dependencies , I think it says they are missing. I don't quite understand.
Any ideas?
Those ext ones are expected and not critical. You need to show whole window, not a small part.
ofcourse
Maybe you have 32-bit python and you installed 64-bit package