@@ -40,6 +40,33 @@ def __init__(self, hop_size: int = 256, threshold: float = 0.5):
4040 "./ten_vad_library/libten_vad"
4141 )
4242 self .vad_library = CDLL (pip_path )
43+ elif platform .system ().upper () == 'WINDOWS' :
44+ if platform .machine ().upper () in ['X64' , 'X86_64' , 'AMD64' ]:
45+ git_path = os .path .join (
46+ os .path .dirname (os .path .relpath (__file__ )),
47+ "../lib/Windows/x64/ten_vad.dll"
48+ )
49+ if os .path .exists (git_path ):
50+ self .vad_library = CDLL (git_path )
51+ else :
52+ pip_path = os .path .join (
53+ os .path .dirname (os .path .relpath (__file__ )),
54+ "./ten_vad_library/ten_vad.dll"
55+ )
56+ self .vad_library = CDLL (pip_path )
57+ else :
58+ git_path = os .path .join (
59+ os .path .dirname (os .path .relpath (__file__ )),
60+ "../lib/Windows/x86/ten_vad.dll"
61+ )
62+ if os .path .exists (git_path ):
63+ self .vad_library = CDLL (git_path )
64+ else :
65+ pip_path = os .path .join (
66+ os .path .dirname (os .path .relpath (__file__ )),
67+ "./ten_vad_library/ten_vad.dll"
68+ )
69+ self .vad_library = CDLL (pip_path )
4370 else :
4471 raise NotImplementedError (f"Unsupported platform: { platform .system ()} { platform .machine ()} " )
4572 self .vad_handler = c_void_p (0 )
0 commit comments