Skip to content

Commit

Permalink
added windows arm64 libs
Browse files Browse the repository at this point in the history
  • Loading branch information
matt200-ok committed Jan 11, 2025
1 parent 00f1e38 commit 02eb7e4
Show file tree
Hide file tree
Showing 21 changed files with 120 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ body:
- Web (WASM)
- Linux (x86_64)
- macOS (x86_64, arm64)
- Windows (x86_64)
- Windows (x86_64, arm64)
- Raspberry Pi
validations:
required: true
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/c-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,17 @@ jobs:
strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]

make_file: ["Unix Makefiles"]
include:
- machine: pv-windows-arm64
make_file: "MinGW Makefiles"
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Create build directory
run: cmake -B ./build
run: cmake -G "${{ matrix.make_file }}" -B ./build

- name: Build micdemo
run: cmake --build ./build --target cobra_demo_mic
Expand Down Expand Up @@ -109,6 +112,7 @@ jobs:
strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
make_file: ["Unix Makefiles"]
include:
- machine: rpi3-32
platform: raspberry-pi
Expand All @@ -125,14 +129,18 @@ jobs:
- machine: rpi5-64
platform: raspberry-pi
arch: cortex-a76-aarch64
- machine: pv-windows-arm64
platform: windows
arch: arm64
make_file: "MinGW Makefiles"

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Create build directory
run: cmake -B ./build
run: cmake -G "${{ matrix.make_file }}" -B ./build

- name: Build filedemo
run: cmake --build ./build --target cobra_demo_file
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/nodejs-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
yarn install
yarn build
working-directory: binding/nodejs
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: yarn install

Expand All @@ -50,11 +58,19 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
yarn install
yarn build
working-directory: binding/nodejs
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: yarn install

Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/nodejs-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,26 @@ jobs:
- name: Machine state after
working-directory: res/scripts
run: bash machine-state.sh

perf-windows-arm64:
runs-on: ${{ matrix.machine }}

strategy:
fail-fast: false
matrix:
machine: [pv-windows-arm64]
include:
- machine: pv-windows-arm64
num_test_iterations: 50

steps:
- uses: actions/checkout@v3

- name: Pre-build dependencies
run: npm install --global yarn

- name: Install dependencies
run: yarn install

- name: Test
run: yarn test perf.test.ts --access_key=${{secrets.PV_VALID_ACCESS_KEY}} --num_test_iterations=${{matrix.num_test_iterations}} --proc_performance_threshold_sec=0.005
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/python-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ jobs:
- name: Pre-build dependencies
run: python -m pip install --upgrade pip

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
python3 -m pip install setuptools wheel
python3 -m setup sdist bdist_wheel
working-directory: binding/python
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: pip install -r requirements.txt

Expand All @@ -50,11 +58,19 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
python3 -m pip install setuptools wheel
python3 -m setup sdist bdist_wheel
working-directory: binding/python
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: pip3 install -r requirements.txt

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/python-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,27 @@ jobs:
- name: Machine state after
working-directory: res/scripts
run: bash machine-state.sh

perf-windows-arm64:
runs-on: ${{ matrix.machine }}

strategy:
fail-fast: false
matrix:
machine: [pv-windows-arm64]
include:
- machine: pv-windows-arm64
num_test_iterations: 100
performance_threshold_sec: 0.006

steps:
- uses: actions/checkout@v3

- name: Pre-build dependencies
run: python3 -m pip install --upgrade pip

- name: Install dependencies
run: pip3 install -r requirements.txt

- name: Test
run: python3 test_cobra_perf.py ${{secrets.PV_VALID_ACCESS_KEY}} ${{matrix.num_test_iterations}} ${{matrix.performance_threshold_sec}}
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
strategy:
fail-fast: false
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions binding/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Cobra is an on-device streaming voice activity detection engine. Cobra is:
- Private; All voice processing runs locally.
- Accurate [[1]](https://picovoice.ai/docs/benchmark/vad/#results)
- Cross-Platform:
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64)
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64, arm64)
- Android and iOS
- Chrome, Safari, Firefox, and Edge
- Raspberry Pi (3, 4, 5)

## Compatibility

- Node.js 16+
- Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64), and Raspberry Pi (3, 4, 5).
- Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64), and Raspberry Pi (3, 4, 5).

## Installation

Expand Down
2 changes: 1 addition & 1 deletion binding/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/cobra-node",
"version": "2.0.2",
"version": "2.0.3",
"description": "Picovoice Cobra Node.js binding",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
10 changes: 7 additions & 3 deletions binding/nodejs/src/platforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ SYSTEM_TO_LIBRARY_PATH.set(
`${SYSTEM_WINDOWS}/${X86_64}`,
`${PLATFORM_WINDOWS}/amd64/pv_cobra.node`
);
SYSTEM_TO_LIBRARY_PATH.set(
`${SYSTEM_WINDOWS}/${ARM_64}`,
`${PLATFORM_WINDOWS}/arm64/pv_cobra.node`
);

function absoluteLibraryPath(libraryPath: string): string {
return path.resolve(__dirname, LIBRARY_PATH_PREFIX, libraryPath);
Expand Down Expand Up @@ -127,7 +131,7 @@ export function getPlatform(): string {
return PLATFORM_MAC;
}

if (system === SYSTEM_WINDOWS && arch === X86_64) {
if (system === SYSTEM_WINDOWS && (arch === X86_64 || arch === ARM_64)) {
return PLATFORM_WINDOWS;
}

Expand Down Expand Up @@ -175,9 +179,9 @@ export function getSystemLibraryPath(): string {
}
break;
case SYSTEM_WINDOWS:
if (arch === X86_64) {
if (arch === X86_64 || arch == ARM_64) {
return absoluteLibraryPath(
SYSTEM_TO_LIBRARY_PATH.get(`${SYSTEM_WINDOWS}/${X86_64}`)
SYSTEM_TO_LIBRARY_PATH.get(`${SYSTEM_WINDOWS}/${arch}`)
);
}
break;
Expand Down
2 changes: 1 addition & 1 deletion binding/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Cobra is a highly accurate and lightweight voice activity detection (VAD) engine
## Compatibility

- Python 3.8+
- Runs on Linux (x86_64), macOS (x86_64), Windows (x86_64), and Raspberry Pi (3, 4, 5).
- Runs on Linux (x86_64), macOS (x86_64), Windows (x86_64, arm64), and Raspberry Pi (3, 4, 5).

## Installation

Expand Down
5 changes: 4 additions & 1 deletion binding/python/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def pv_library_path(relative):
relative,
'lib/raspberry-pi/%s/libpv_cobra.so' % _PV_MACHINE)
elif _PV_SYSTEM == 'Windows':
return os.path.join(os.path.dirname(__file__), relative, 'lib/windows/amd64/libpv_cobra.dll')
if platform.machine().lower() == 'amd64':
return os.path.join(os.path.dirname(__file__), relative, 'lib/windows/amd64/libpv_cobra.dll')
elif platform.machine().lower() == 'arm64':
return os.path.join(os.path.dirname(__file__), relative, 'lib/windows/arm64/libpv_cobra.dll')

raise NotImplementedError('Unsupported platform.')
3 changes: 2 additions & 1 deletion binding/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
include pvcobra/lib/mac/arm64/libpv_cobra.dylib
recursive-include pvcobra/lib/raspberry-pi *
include pvcobra/lib/windows/amd64/libpv_cobra.dll
include pvcobra/lib/windows/arm64/libpv_cobra.dll
"""

with open(os.path.join(os.path.dirname(__file__), 'MANIFEST.in'), 'w') as f:
Expand All @@ -55,7 +56,7 @@

setuptools.setup(
name="pvcobra",
version="2.0.3",
version="2.0.4",
author="Picovoice",
author_email="[email protected]",
description="Cobra voice activity detection (VAD) engine",
Expand Down
4 changes: 2 additions & 2 deletions demo/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Cobra is an on-device voice activity detection engine. Cobra is:
- Private; All voice processing runs locally.
- Accurate [[1]](https://picovoice.ai/docs/benchmark/vad/#results)
- Cross-Platform:
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64)
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64, arm64)
- Android and iOS
- Chrome, Safari, Firefox, and Edge
- Raspberry Pi (3, 4, 5)

## Compatibility

- Node.js 16+
- Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64), and Raspberry Pi (3, 4, 5).
- Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64), and Raspberry Pi (3, 4, 5).

## Installation

Expand Down
4 changes: 2 additions & 2 deletions demo/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/cobra-node-demo",
"version": "2.0.2",
"version": "2.0.3",
"description": "Picovoice Cobra Node.js file-based and microphone demos",
"scripts": {
"file": "node file.js",
Expand All @@ -16,7 +16,7 @@
"author": "Picovoice Inc.",
"license": "Apache-2.0",
"dependencies": {
"@picovoice/cobra-node": "=2.0.2",
"@picovoice/cobra-node": "../../binding/nodejs",
"@picovoice/pvrecorder-node": "~1.2.3",
"commander": "^6.1.0",
"readline": "^1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion demo/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Cobra is a highly accurate and lightweight voice activity detection (VAD) engine
## Compatibility

- Python 3.8+
- Runs on Linux (x86_64), macOS (x86_64 and arm64), Windows (x86_64), and Raspberry Pi (3, 4, 5).
- Runs on Linux (x86_64), macOS (x86_64 and arm64), Windows (x86_64, arm64), and Raspberry Pi (3, 4, 5).

## AccessKey

Expand Down
2 changes: 1 addition & 1 deletion demo/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pvcobra==2.0.3
../../binding/python/dist/pvcheetah-2.0.4-py3-none-any.whl
pvrecorder==1.2.2
4 changes: 2 additions & 2 deletions demo/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@

setuptools.setup(
name="pvcobrademo",
version="2.0.3",
version="2.0.4",
author="Picovoice",
author_email="[email protected]",
description="Cobra voice activity detection (VAD) engine demos.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Picovoice/cobra",
packages=["pvcobrademo"],
install_requires=["pvcobra==2.0.3", "pvrecorder==1.2.2"],
install_requires=["pvcobra==2.0.4", "pvrecorder==1.2.2"],
include_package_data=True,
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand Down
Binary file added lib/node/windows/arm64/pv_cobra.node
Binary file not shown.
Binary file added lib/windows/arm64/libpv_cobra.dll
Binary file not shown.

0 comments on commit 02eb7e4

Please sign in to comment.