Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

## Latest News 🔥

- [2025/07] We support **Python inference** on **macOS** with usage of the prebuilt-lib!
- [2025/07] We support **Python inference** on **macOS** and **Windows** with usage of the prebuilt-lib!
- [2025/06] We **finally** released and **open-sourced** the **ONNX** model and the corresponding **preprocessing code**! Now you can deploy **TEN VAD** on **any platform** and **any hardware architecture**!
- [2025/06] We are excited to announce the release of **WASM+JS** for Web WASM Support.

Expand Down Expand Up @@ -285,7 +285,7 @@ The project supports five major platforms with dynamic library linking.

### **Python Usage**

#### **1. Linux / macOS**
#### **1. Linux / macOS / Windows**

#### **Requirements**

Expand Down
27 changes: 27 additions & 0 deletions include/ten_vad.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,33 @@ def __init__(self, hop_size: int = 256, threshold: float = 0.5):
"./ten_vad_library/libten_vad"
)
self.vad_library = CDLL(pip_path)
elif platform.system().upper() == 'WINDOWS':
if platform.machine().upper() in ['X64', 'X86_64', 'AMD64']:
git_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"../lib/Windows/x64/ten_vad.dll"
)
if os.path.exists(git_path):
self.vad_library = CDLL(git_path)
else:
pip_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"./ten_vad_library/ten_vad.dll"
)
self.vad_library = CDLL(pip_path)
else:
git_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"../lib/Windows/x86/ten_vad.dll"
)
if os.path.exists(git_path):
self.vad_library = CDLL(git_path)
else:
pip_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"./ten_vad_library/ten_vad.dll"
)
self.vad_library = CDLL(pip_path)
else:
raise NotImplementedError(f"Unsupported platform: {platform.system()} {platform.machine()}")
self.vad_handler = c_void_p(0)
Expand Down
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ def run(self):
shutil.copy("lib/macOS/ten_vad.framework/Versions/A/ten_vad",
os.path.join(target_dir, "libten_vad"))
print(f"macOS library installed to: {target_dir}")
elif platform.system().upper() == 'WINDOWS':
if platform.machine().upper() in ['X64', 'X86_64', 'AMD64']:
shutil.copy("lib/Windows/x64/ten_vad.dll",
os.path.join(target_dir, "ten_vad.dll"))
print(f"Windows x64 library installed to: {target_dir}")
else:
shutil.copy("lib/Windows/x86/ten_vad.dll",
os.path.join(target_dir, "ten_vad.dll"))
print(f"Windows x86 library installed to: {target_dir}")
else:
raise NotImplementedError(f"Unsupported platform: {platform.system()} {platform.machine()}")

Expand Down