We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3bf089b + 33a48cc commit 2096d6aCopy full SHA for 2096d6a
chromaprint.py
@@ -6,6 +6,7 @@
6
7
import sys
8
import ctypes
9
+import ctypes.util
10
11
if sys.version_info[0] >= 3:
12
BUFFER_TYPES = (memoryview, bytearray,)
@@ -31,9 +32,19 @@ def _guess_lib_name():
31
32
return ('libchromaprint.so.1', 'libchromaprint.so.0')
33
34
35
+def _load_library(name):
36
+ if sys.platform == 'win32':
37
+ try:
38
+ return ctypes.cdll.LoadLibrary(ctypes.util.find_library(name))
39
+ except TypeError:
40
+ raise OSError()
41
+ else:
42
+ return ctypes.cdll.LoadLibrary(name)
43
+
44
45
for name in _guess_lib_name():
46
try:
- _libchromaprint = ctypes.cdll.LoadLibrary(name)
47
+ _libchromaprint = _load_library(name)
48
break
49
except OSError:
50
pass
0 commit comments