diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index c68f23a..1a8fcdd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -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 diff --git a/.github/workflows/c-demos.yml b/.github/workflows/c-demos.yml index 0f5bf62..02b97e5 100644 --- a/.github/workflows/c-demos.yml +++ b/.github/workflows/c-demos.yml @@ -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 @@ -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 @@ -125,6 +129,10 @@ 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 @@ -132,7 +140,7 @@ jobs: 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 diff --git a/.github/workflows/nodejs-demos.yml b/.github/workflows/nodejs-demos.yml index 6d55540..442f5af 100644 --- a/.github/workflows/nodejs-demos.yml +++ b/.github/workflows/nodejs-demos.yml @@ -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 @@ -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 diff --git a/.github/workflows/nodejs-perf.yml b/.github/workflows/nodejs-perf.yml index 16788e0..9cbddda 100644 --- a/.github/workflows/nodejs-perf.yml +++ b/.github/workflows/nodejs-perf.yml @@ -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 diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 746acbb..fdcd94d 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -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 diff --git a/.github/workflows/python-demos.yml b/.github/workflows/python-demos.yml index 4ae6167..1420e00 100644 --- a/.github/workflows/python-demos.yml +++ b/.github/workflows/python-demos.yml @@ -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 @@ -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 diff --git a/.github/workflows/python-perf.yml b/.github/workflows/python-perf.yml index 11de6cb..c3cf223 100644 --- a/.github/workflows/python-perf.yml +++ b/.github/workflows/python-perf.yml @@ -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}} diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index c79407c..3acca5d 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -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 diff --git a/binding/nodejs/README.md b/binding/nodejs/README.md index b90af92..47a2c83 100644 --- a/binding/nodejs/README.md +++ b/binding/nodejs/README.md @@ -9,7 +9,7 @@ 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) @@ -17,7 +17,7 @@ Cobra is an on-device streaming voice activity detection engine. Cobra is: ## 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 diff --git a/binding/nodejs/package.json b/binding/nodejs/package.json index 52a2cd0..4a94e85 100644 --- a/binding/nodejs/package.json +++ b/binding/nodejs/package.json @@ -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", diff --git a/binding/nodejs/src/platforms.ts b/binding/nodejs/src/platforms.ts index 981f8f0..85a32cd 100644 --- a/binding/nodejs/src/platforms.ts +++ b/binding/nodejs/src/platforms.ts @@ -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); @@ -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; } @@ -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; diff --git a/binding/python/README.md b/binding/python/README.md index d8598e5..c8b5906 100644 --- a/binding/python/README.md +++ b/binding/python/README.md @@ -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 diff --git a/binding/python/_util.py b/binding/python/_util.py index 9a71668..33dc21d 100644 --- a/binding/python/_util.py +++ b/binding/python/_util.py @@ -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.') diff --git a/binding/python/setup.py b/binding/python/setup.py index 40d3d11..bbe9ab9 100644 --- a/binding/python/setup.py +++ b/binding/python/setup.py @@ -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: @@ -55,7 +56,7 @@ setuptools.setup( name="pvcobra", - version="2.0.3", + version="2.0.4", author="Picovoice", author_email="hello@picovoice.ai", description="Cobra voice activity detection (VAD) engine", diff --git a/demo/nodejs/README.md b/demo/nodejs/README.md index 2aef7df..cc0f86e 100644 --- a/demo/nodejs/README.md +++ b/demo/nodejs/README.md @@ -9,7 +9,7 @@ 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) @@ -17,7 +17,7 @@ Cobra is an on-device voice activity detection engine. Cobra is: ## 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 diff --git a/demo/nodejs/package.json b/demo/nodejs/package.json index 4ff0535..641fca0 100644 --- a/demo/nodejs/package.json +++ b/demo/nodejs/package.json @@ -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", @@ -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", diff --git a/demo/python/README.md b/demo/python/README.md index e59b859..b28aa53 100644 --- a/demo/python/README.md +++ b/demo/python/README.md @@ -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 diff --git a/demo/python/requirements.txt b/demo/python/requirements.txt index ceda589..07d84dd 100644 --- a/demo/python/requirements.txt +++ b/demo/python/requirements.txt @@ -1,2 +1,2 @@ -pvcobra==2.0.3 +../../binding/python/dist/pvcheetah-2.0.4-py3-none-any.whl pvrecorder==1.2.2 diff --git a/demo/python/setup.py b/demo/python/setup.py index 7c70024..6d65e7a 100644 --- a/demo/python/setup.py +++ b/demo/python/setup.py @@ -28,7 +28,7 @@ setuptools.setup( name="pvcobrademo", - version="2.0.3", + version="2.0.4", author="Picovoice", author_email="hello@picovoice.ai", description="Cobra voice activity detection (VAD) engine demos.", @@ -36,7 +36,7 @@ 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", diff --git a/lib/node/windows/arm64/pv_cobra.node b/lib/node/windows/arm64/pv_cobra.node new file mode 100644 index 0000000..e202d45 Binary files /dev/null and b/lib/node/windows/arm64/pv_cobra.node differ diff --git a/lib/windows/arm64/libpv_cobra.dll b/lib/windows/arm64/libpv_cobra.dll new file mode 100644 index 0000000..5af9db7 Binary files /dev/null and b/lib/windows/arm64/libpv_cobra.dll differ