alphacep / alphacep/vosk-api

cannot importing libvosk.dll

Open
#1,549 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
15.1k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

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
![image](https://github.com/alphacep/vosk-api/assets/132943905/b69dbc70-9132-49b5-80b4-b2b40b49a9ec)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.