Skip to content

Commit 23e3190

Browse files
authored
Fix bug in windows python demo
1 parent 3520d10 commit 23e3190

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/ten_vad.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,27 @@ def __init__(self, hop_size: int = 256, threshold: float = 0.5):
4343
elif platform.system().upper() == 'WINDOWS':
4444
if platform.machine().upper() in ['X64', 'X86_64', 'AMD64']:
4545
git_path = os.path.join(
46-
os.path.dirname(os.path.relpath(__file__)),
46+
os.path.dirname(os.path.realpath(__file__)),
4747
"../lib/Windows/x64/ten_vad.dll"
4848
)
4949
if os.path.exists(git_path):
5050
self.vad_library = CDLL(git_path)
5151
else:
5252
pip_path = os.path.join(
53-
os.path.dirname(os.path.relpath(__file__)),
53+
os.path.dirname(os.path.realpath(__file__)),
5454
"./ten_vad_library/ten_vad.dll"
5555
)
5656
self.vad_library = CDLL(pip_path)
5757
else:
5858
git_path = os.path.join(
59-
os.path.dirname(os.path.relpath(__file__)),
59+
os.path.dirname(os.path.realpath(__file__)),
6060
"../lib/Windows/x86/ten_vad.dll"
6161
)
6262
if os.path.exists(git_path):
6363
self.vad_library = CDLL(git_path)
6464
else:
6565
pip_path = os.path.join(
66-
os.path.dirname(os.path.relpath(__file__)),
66+
os.path.dirname(os.path.realpath(__file__)),
6767
"./ten_vad_library/ten_vad.dll"
6868
)
6969
self.vad_library = CDLL(pip_path)

0 commit comments

Comments
 (0)